Automated transpose
Browse filesSigned-off-by: Jiri Podivin <jpodivin@gmail.com>
- plantorgans.py +2 -1
plantorgans.py
CHANGED
|
@@ -2,6 +2,7 @@ import datasets
|
|
| 2 |
import pandas as pd
|
| 3 |
import glob
|
| 4 |
from pathlib import Path
|
|
|
|
| 5 |
|
| 6 |
_DESCRIPTION = """Photos of various plants with their major, above ground organs labeled. Includes labels for stem, leafs, fruits and flowers."""
|
| 7 |
|
|
@@ -137,7 +138,7 @@ class PlantOrgans(datasets.GeneratorBasedBuilder):
|
|
| 137 |
# and name of source image.
|
| 138 |
example = {
|
| 139 |
'mask': r['mask_path'],
|
| 140 |
-
'image': r['image_path'],
|
| 141 |
'image_name': Path(r['image_path']).parts[-1],
|
| 142 |
'score': r['score']
|
| 143 |
}
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import glob
|
| 4 |
from pathlib import Path
|
| 5 |
+
from PIL import Image, ImageOps
|
| 6 |
|
| 7 |
_DESCRIPTION = """Photos of various plants with their major, above ground organs labeled. Includes labels for stem, leafs, fruits and flowers."""
|
| 8 |
|
|
|
|
| 138 |
# and name of source image.
|
| 139 |
example = {
|
| 140 |
'mask': r['mask_path'],
|
| 141 |
+
'image': ImageOps.exif_transpose(Image.open(r['image_path'])),
|
| 142 |
'image_name': Path(r['image_path']).parts[-1],
|
| 143 |
'score': r['score']
|
| 144 |
}
|