Skip to content

Commit 321ff8e

Browse files
committed
add detr as submodule
detr as submodule detr as submodule detr as submodule
1 parent f029e1d commit 321ff8e

File tree

16 files changed

+33
-1512
lines changed

16 files changed

+33
-1512
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "examples/post_training_quantization/coco2017/DETR/detr"]
2+
path = examples/post_training_quantization/coco2017/DETR/detr
3+
url = https://github.com/facebookresearch/detr.git
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from pathlib import Path
2+
from detr.datasets.coco import CocoDetection, make_coco_transforms
3+
4+
def build(image_set, args):
5+
root = Path(args.coco_path)
6+
assert root.exists(), f'provided COCO path {root} does not exist'
7+
mode = 'instances'
8+
PATHS = {
9+
"train": (root / "train2017", root / "annotations" / f'{mode}_train2017.json'),
10+
"val": (root / "val2017", root / "annotations" / f'{mode}_val2017.json'),
11+
}
12+
13+
img_folder, ann_file = PATHS[image_set]
14+
dataset = CocoDetection(img_folder, ann_file, transforms=make_coco_transforms("val"), return_masks=args.masks)
15+
return dataset
16+
17+
def build_dataset(image_set, args):
18+
if args.dataset_file == 'coco':
19+
return build(image_set, args)
20+
raise ValueError(f'dataset {args.dataset_file} not supported')

examples/post_training_quantization/coco2017/DETR/datasets/__init__.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/post_training_quantization/coco2017/DETR/datasets/coco.py

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)