Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask of people is incorrect #7

Closed
duanzhiihao opened this issue May 28, 2019 · 7 comments
Closed

Mask of people is incorrect #7

duanzhiihao opened this issue May 28, 2019 · 7 comments

Comments

@duanzhiihao
Copy link

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?

@gjy3035
Copy link
Owner

gjy3035 commented May 29, 2019

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)

@duanzhiihao
Copy link
Author

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.

@gjy3035
Copy link
Owner

gjy3035 commented May 29, 2019

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.

@Elin24
Copy link
Collaborator

Elin24 commented May 29, 2019

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

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

@gjy3035
Copy link
Owner

gjy3035 commented May 29, 2019

@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.

@duanzhiihao
Copy link
Author

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

@2811299
Copy link

2811299 commented Sep 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants