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

To cityscape format? #38

Closed
Goooyi opened this issue Apr 2, 2022 · 1 comment
Closed

To cityscape format? #38

Goooyi opened this issue Apr 2, 2022 · 1 comment

Comments

@Goooyi
Copy link

Goooyi commented Apr 2, 2022

Thanks for this work, I notice that bpycv support cityscape format, I want to ask is there a demo or doc to demonstrate how to save the results as cityscape format?

@DIYer22
Copy link
Owner

DIYer22 commented Apr 2, 2022

Cityscapes style: Similar to *_instanceIds.png in Cityscapes dataset, those png file are Height * Width * 16bit. Each pixel value x means that the pixel belongs to the instance ID is x.

For instance ID x, the corresponding categories_id is x//1000. For example, instance ID 3002, means it's categories_id id is 3002//1000 = 3

Thus, you should set your object with object["inst_id"] = categories_id * 1000 + index
Then

result = bpycv.render_data()
cv2.imwrite("demo-inst.png", np.uint16(result["inst"]))

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

2 participants