gjy3035 / GCC-CL

GCC dataset Collector and Labeler (GCC CL) [CVPR2019]

Home Page:https://gjy3035.github.io/GCC-CL/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mask of people is incorrect

duanzhiihao opened this issue · comments

Hi, I have successfully generated scenes. I want to generate binary masks of people then. So, I directly run the main.py in GCC-Labeler, then read and show the .raw file:

raw_path = 'D:/Codes/gta5dataset/scene_1_0/segs/1558631488.raw'

seg = np.fromfile(raw_path, 'uint8')
seg = seg.reshape(1440, 2560) # I use a 2k resollution GTA V

plt.imshow(s,cmap='gray')
plt.show()

Then the figure is like this:
image
The original GTA V scene is:
image

It seems that there is something wrong. I also visualized the GTA V/data/part_1_0/xxxxxxxx/part_0.raw(.raw file created by GCC-Collector), and it is the same as the above black&white image.
Could you tell me where should I look at to solve this problem?

Please check the intermediate results (part_xxx.raw) of the crowd mask.

Our translation code is shown below:

dst_file = os.path.join(mask_folder,preprocess_file[0:10] + '.png')
if not os.path.exists(dst_file):
    mask = np.fromfile(os.path.join(root_path, i_scene, i_type, preprocess_file), 'uint8').reshape(1080, 1920)*255               
    mask = Image.fromarray(mask)
    # pdb.set_trace()
    mask.save(dst_file)

Thank you for your reply. I read the part_xxx.raw and try to show it,

raw_path = 'D:/GAME/Steam/steamapps/common/Grand Theft Auto V/data/part_1_0/1558631488/part_0.raw'

mask = np.fromfile(raw_path,dtype='uint8').reshape(1440, 2560) * 255

# matplotlib
plt.imshow(mask, cmap='gray')
plt.show()

# PIL.Image
mask = Image.fromarray(mask)
mask.show()

The result is same as before:
image

Do you create and save the .raw file in main.cpp? I'm looking at your source code.

part_xxx.raw contains many types of objects, I think you should show it using a color mask instead of a gray image.
in order to get the crowd mask from part_xxx.raw file, we analyze the stencil and select the specific indices, which is shown in function getCurve of combine.py. I think this file maybe help you debug your code.

The white region is minimap, which is at the top layer of *.raw file.

So the solution is close minimap when running GCC-Collector.

@Elin24 I do not think the map disturbs the raw file. In our generation process, some images also contain map region but the crowd mask seems to be correct.

I close the minimap and it works. Thank you all @gjy3035 @Elin24

Hi guys , why I'm getting a balck image, I just want to generate images with people masked..
I really appreciate it if anyone could reply.