luoxin13 / CROTS

SpatialMix and Hard Patches Mining for Black-Box Model Adaptation in Semantic Segmentation
6 stars 0 forks source link

transfer_trainid.py #1

Open wy789 opened 8 months ago

wy789 commented 8 months ago

Can you give me the transfer_trainid.py file?thank you

luoxin13 commented 8 months ago

Sorry for the late reply. I cannot find the original script. However, its implementation is easy.

You can open the label file with PIL.Image and numpy.

Then you can map the trainID for each label file.

The mapping is :

id_to_trainid = {7: 0, 8: 1, 11: 2, 12: 3, 13: 4, 17: 5, 19: 6, 20: 7, 21: 8, 22: 9, 23: 10, 24: 11, 25: 12, 26: 13, 27: 14, 28: 15, 31: 16, 32: 17, 33: 18}

After mapping, saving the id-mapped file as png format.

-----原始邮件----- 发件人:wy789 @.> 发送时间:2024-01-25 18:55:27 (星期四) 收件人: luoxin13/CROTS @.> 抄送: Subscribed @.***> 主题: [luoxin13/CROTS] transfer_trainid.py (Issue #1)

Can you give me the transfer_trainid.py file?thank you

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

wy789 commented 7 months ago

Thank you for your reply!