Skip to content

Commit 9c2b20e

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent 55d3945 commit 9c2b20e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

roboflow/util/folderparser.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,16 @@ def _build_image_and_annotation_maps(annotationFiles):
132132
)
133133
if parsedType == "coco":
134134
for imageRef in parsed["images"]:
135-
imgRefMap[os.path.join(filename, imageRef['file_name'])] = imageRef
135+
imgRefMap[os.path.join(filename, imageRef["file_name"])] = imageRef
136136
for annotation in parsed["annotations"]:
137-
annotationMap[os.path.join(dirname, annotation['image_id'])].append(annotation)
137+
annotationMap[os.path.join(dirname, annotation["image_id"])].append(annotation)
138138
return imgRefMap, annotationMap
139139

140140

141141
def _filterIndividualAnnotations(image, annotation, format, imgRefMap, annotationMap):
142142
parsed = annotation["parsed"]
143143
if format == "coco":
144-
imgReference = imgRefMap.get(os.path.join(annotation['file'], image['name']))
144+
imgReference = imgRefMap.get(os.path.join(annotation["file"], image["name"]))
145145
if imgReference:
146146
# workaround to make Annotations.js correctly identify this as coco in the backend
147147
fake_annotation = {
@@ -153,9 +153,7 @@ def _filterIndividualAnnotations(image, annotation, format, imgRefMap, annotatio
153153
"iscrowd": 0,
154154
}
155155
_annotation = {"name": "annotation.coco.json"}
156-
annotations_for_image = annotationMap.get(
157-
os.path.join(image['dirname'], imgReference['id']), []
158-
)
156+
annotations_for_image = annotationMap.get(os.path.join(image["dirname"], imgReference["id"]), [])
159157
_annotation["rawText"] = json.dumps(
160158
{
161159
"info": parsed["info"],

0 commit comments

Comments
 (0)