You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to specify a config option that disables EXIF orientation corrections.
Motivation & Examples
I have a coco-style dataset where all annotations are stored with respect to the encoded image size on disk. In other words the annotations ignore the EXIF information. I could attempt to modify my dataset to correct for this, but then it will break with all of my tools which will not apply any EXIF transforms. It would be much easier to interoperate with detectron2.
I've been able to work around this on my end by just adding the patch:
diff --git a/detectron2/data/detection_utils.py b/detectron2/data/detection_utils.py
index 8d6173e..4b7bc19 100644
--- a/detectron2/data/detection_utils.py+++ b/detectron2/data/detection_utils.py@@ -135,6 +135,7 @@ def _apply_exif_orientation(image):
Returns:
(PIL.Image): the PIL image with exif orientation applied, if applicable
"""
+ return image
if not hasattr(image, "getexif"):
return image
which simply skips the exif correction. It would be nice if I could just do something like:
Note on my end, I need to think about how to support EXIF data for the case where the user does want to respect it by default. I've opened an issue for that here: https://gitlab.kitware.com/computer-vision/kwcoco/-/issues/15 but it would be nice if detectron2 could also provide the ability to work with both the case where the underlying coco-style dataset registers the images in a way that ignores exif or accounts for exif, and I think the patch would be rather small.
🚀 Feature
I would like to be able to specify a config option that disables EXIF orientation corrections.
Motivation & Examples
I have a coco-style dataset where all annotations are stored with respect to the encoded image size on disk. In other words the annotations ignore the EXIF information. I could attempt to modify my dataset to correct for this, but then it will break with all of my tools which will not apply any EXIF transforms. It would be much easier to interoperate with detectron2.
I've been able to work around this on my end by just adding the patch:
which simply skips the exif correction. It would be nice if I could just do something like:
and use detectron2 without modification of the code or dataset.
I could make this PR, but I would like input from maintainers before I do.
The text was updated successfully, but these errors were encountered: