Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 631234257
  • Loading branch information
markmcd authored and copybara-github committed May 7, 2024
1 parent 4824b07 commit eec3051
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mediapipe/model_maker/python/vision/object_detector/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ def from_coco_folder(
- https://cocodataset.org/#home
Folder structure should be:
```
<data_dir>/
images/
<file0>.jpg
...
labels.json
```
The `labels.json` annotations file should should have the following format:
```
{
"categories": [{"id": 0, "name": "background"}, ...],
"images": [{"id": 0, "file_name": "<file0>.jpg"}, ...],
Expand All @@ -55,6 +60,8 @@ def from_coco_folder(
"bbox": [x-top left, y-top left, width, height],
}, ...]
}
```
Note that category id 0 is reserved for the "background" class. It is
optional to include, but if included it must be set to "background".
Expand Down Expand Up @@ -99,14 +106,20 @@ def from_pascal_voc_folder(
- http://host.robots.ox.ac.uk/pascal/VOC.
Folder structure should be:
```
<data_dir>/
images/
<file0>.jpg
...
Annotations/
<file0>.xml
...
```
Each <file0>.xml annotation file should have the following format:
```
<annotation>
<filename>file0.jpg</filename>
<object>
Expand All @@ -120,6 +133,7 @@ def from_pascal_voc_folder(
</object>
<object>...</object>
</annotation>
```
Args:
data_dir: Name of the directory containing the data files.
Expand Down

0 comments on commit eec3051

Please sign in to comment.