Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix-file saving for uppercase image formats, i.e. JPG and PNG. (#352)
Summary: Thank you for your code. This PR is a minor fix to the upper letter format issue. Saving the visualized files with '**JPG**' format (upper letters) will result in: > Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). although the image range is between [0-255] and in uint8 format. The current code uses cv2 to save for '**_png_**' and '**_jpg_**' format but it won't check for any uppercase file formats. For example, if it is '**JPG**' it will not consider it 'jpg' and won't use cv2. A small fix using lower() function will fix this issue. I'm not sure if there are any other hardcoded formats inside of the code in other parts, but if there is a comparison, we should consider upper and lower strings. Pull Request resolved: facebookresearch/detectron2#352 Differential Revision: D18743401 Pulled By: ppwwyyxx fbshipit-source-id: f4bbb2a845f6c702cb0ba4a29f2e5d0687733f5c
- Loading branch information