-
Notifications
You must be signed in to change notification settings - Fork 140
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
all pixel values as 0 during hrnet-ocr inference in label folder and 255 in label_w_segfix with segfix #72
Comments
I have found the issue. In openseg.pytorch/segmentor/tester.py , at line number 193, we are saving the image by "ImageHelper.save(label_img_, label_path)". If saving the original label_img_ numpy array with cv2.imwrite(), the issue is resolved and the labels are correctly produced. |
@thegigasurgeon Many thanks! |
@ZSL98 @thegigasurgeon Hello, I have met the same problem. I want to know how to change the code block, could you please tell me with more details? |
@Wang in the file openseg.pytorch/segmentor/tester.py, replace "ImageHelper.save(label_img_, label_path)" with "cv2.imwrite(label_path, label_img_) ". |
evaluate the result... |
@Wang in the file segmentor/tester.py near line no 189 to 193
For me, this fixed the problem. You can also try visualisizing the image array before these lines to see if the values are correct. For me, this had fixed the problem. |
I have been trying to reproduce the results with pretrained weights using "bash scripts/cityscapes/hrnet/run_h_48_d_4_ocr.sh val".
Inside the vis folder that is generated, the outputs are fine. But inside the label folder, every pixel value is 0.
After trying segfix, label_w_segfix folder is generated. Every pixel for every image in that folder is 255. Help me out.
The text was updated successfully, but these errors were encountered: