-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data): working (slow) dataloaders!
- Create a FiftyOne Dataset Exporter to export labels to lmdb - Use LMDB to fetch labels for SegmentationDataset - Add appropriate dependecies (cv2,lmdb, pycocotools) - Add Hydra configurations Dataloaders are slow, will be profiled. may need more breaking changes.
- Loading branch information
1 parent
9b21e3a
commit dff3404
Showing
9 changed files
with
1,179 additions
and
798 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
_target_: lightningsparseinst | ||
name: 'Cityscapes' | ||
ref: 'cityscapes' | ||
gt_field: 'gt_coarse' | ||
detection_field: 'polylines' | ||
train_split_name: 'train' | ||
validation_split_name: 'validation' | ||
test_split_name: 'test' | ||
classes: '^(?!out of roi$).*' # filtering out the | ||
transforms: | ||
_target_: albumentations.Compose | ||
transforms: | ||
- _target_: albumentations. | ||
- _target_: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
_target_: lightningsparseinst.data.dataset.SegmentationDataset | ||
name: 'COCO-2017' | ||
ref: 'coco-2017' #controls its cache dir as well | ||
gt_field: 'ground_truth' | ||
detection_field: 'detections' | ||
max_detections: 100 # number used by DETR for coco. it is the max num images+slack | ||
split_names: | ||
train: train | ||
validation: validation | ||
test: test | ||
transform: | ||
_target_: albumentations.Compose | ||
transforms: | ||
- _target_: lightningsparseinst.utils.transforms.ResizeShortestEdge | ||
shortest_max_size: [416, 448, 480, 512, 544, 576, 608, 640] | ||
largest_max_size: 853 | ||
- _target_: albumentations.geometric.PadIfNeeded | ||
min_width: 853 # max size of smallestmaxsize | ||
min_height: 853 | ||
position: random # remove any bias in positioning | ||
- _target_: albumentations.pytorch.ToTensorV2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defaults: | ||
- _self_ | ||
- dataset: coco # pick one of the yamls in nn/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
_target_: lightningsparseinst.data.datamodule.MyDataModule | ||
val_images_fixed_idxs: [7371, 3963, 2861, 1701, 3172, 1749, 7023, 1606, 6481, 1377, 6003, 3593, 3410, 3399, 7277, 5337, 968, 8206, 288, 1968, 5677, 9156, 8139, 7660, 7089, 1893, 3845, 2084, 1944, 3375, 4848, 8704, 6038, 2183, 7422, 2682, 6878, 6127, 2941, 5823, 9129, 1798, 6477, 9264, 476, 3007, 4992, 1428, 9901, 5388] | ||
_target_: lightningsparseinst.data.datamodule.DataModule | ||
accelerator: ${train.trainer.accelerator} | ||
num_workers: | ||
train: 4 | ||
val: 2 | ||
test: 0 | ||
test: 2 | ||
batch_size: | ||
train: 512 | ||
val: 128 | ||
test: 16 | ||
train: 32 | ||
val: 8 | ||
test: 8 | ||
cache_dir: '.cache/data/' # either from Project Root or absolute path | ||
defaults: | ||
- _self_ | ||
- dataset: vision/mnist # pick one of the yamls in nn/data/ | ||
- dataset: coco # pick one of the yamls in nn/data/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,10 @@ testpaths = ["tests"] | |
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"raise NotImplementedError", | ||
"raise NotImplementedError()", | ||
"pragma: nocover", | ||
"if __name__ == .__main__.:", | ||
"raise NotImplementedError", | ||
"raise NotImplementedError()", | ||
"pragma: nocover", | ||
"if __name__ == .__main__.:", | ||
] | ||
[tool.mypy] | ||
files = ["src/**/*.py", "test/*.py"] | ||
|
@@ -48,6 +48,7 @@ description = "SparseInst (CVPR 2022) in PyTorch Lightning" | |
authors = ["Charitarth Chugh <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
package-mode = true | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11, <3.13" | ||
|
@@ -60,6 +61,10 @@ torchmetrics = "^1.5.1" | |
omegaconf = "^2.3.0" | ||
fiftyone = "^1.0.1" | ||
albumentations = "^1.4.21" | ||
opencv-python = "^4.10.0.84" | ||
orjson = "^3.10.12" | ||
lmdb = "^1.5.1" | ||
pycocotools = "^2.0.8" | ||
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.