Skip to content

Commit

Permalink
add detr as submodule
Browse files Browse the repository at this point in the history
detr as submodule

detr as submodule

detr as submodule
  • Loading branch information
Jiang-Stan committed Nov 9, 2022
1 parent f029e1d commit 321ff8e
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 1,512 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples/post_training_quantization/coco2017/DETR/detr"]
path = examples/post_training_quantization/coco2017/DETR/detr
url = https://github.com/facebookresearch/detr.git
20 changes: 20 additions & 0 deletions examples/post_training_quantization/coco2017/DETR/datasets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pathlib import Path
from detr.datasets.coco import CocoDetection, make_coco_transforms

def build(image_set, args):
root = Path(args.coco_path)
assert root.exists(), f'provided COCO path {root} does not exist'
mode = 'instances'
PATHS = {
"train": (root / "train2017", root / "annotations" / f'{mode}_train2017.json'),
"val": (root / "val2017", root / "annotations" / f'{mode}_val2017.json'),
}

img_folder, ann_file = PATHS[image_set]
dataset = CocoDetection(img_folder, ann_file, transforms=make_coco_transforms("val"), return_masks=args.masks)
return dataset

def build_dataset(image_set, args):
if args.dataset_file == 'coco':
return build(image_set, args)
raise ValueError(f'dataset {args.dataset_file} not supported')

This file was deleted.

158 changes: 0 additions & 158 deletions examples/post_training_quantization/coco2017/DETR/datasets/coco.py

This file was deleted.

Loading

0 comments on commit 321ff8e

Please sign in to comment.