Skip to content

Add custom COCO dataset loader function#1997

Draft
lumurillo wants to merge 2 commits intotwosixlabs:masterfrom
lumurillo:add-custom-coco-dataset-loader
Draft

Add custom COCO dataset loader function#1997
lumurillo wants to merge 2 commits intotwosixlabs:masterfrom
lumurillo:add-custom-coco-dataset-loader

Conversation

@lumurillo
Copy link

@lumurillo lumurillo commented Oct 3, 2023

Use PyTorch to load custom COCO compatible datasets into Armory.

Example of scenario configuration JSON:

diff --git a/scenario_configs/eval7/carla_overhead_object_detection/carla_obj_det_adversarialpatch_undefended.json b/scenario_configs/eval7/carla_overhead_object_detection/carla_obj_det_adversarialpatch_undefended.json
index cb914461..4f271427 100644
--- a/scenario_configs/eval7/carla_overhead_object_detection/carla_obj_det_adversarialpatch_undefended.json
+++ b/scenario_configs/eval7/carla_overhead_object_detection/carla_obj_det_adversarialpatch_undefended.json
@@ -6,7 +6,7 @@
         "kwargs": {
             "batch_size": 1,
             "learning_rate": 0.05,
-            "max_iter": 500,
+            "max_iter": 10,
             "optimizer": "Adam",
             "targeted": false,
             "verbose": true
@@ -17,11 +17,10 @@
     },
     "dataset": {
         "batch_size": 1,
-        "eval_split": "dev",
-        "framework": "numpy",
-        "modality": "rgb",
-        "module": "armory.data.adversarial_datasets",
-        "name": "carla_over_obj_det_dev"
+        "dataset_dir": "/home/luismr/carla-datagen-toolkit/data/dev_eval7/rgb",
+        "ann_file": "/home/luismr/carla-datagen-toolkit/data/dev_eval7/kwcoco_annotations.json",
+        "module": "armory.data.datasets",
+        "name": "custom_coco_dataset"
     },
     "defense": null,
     "metric": {
@@ -53,7 +52,8 @@
     "scenario": {
         "kwargs": {},
         "module": "armory.scenarios.carla_object_detection",
-        "name": "CarlaObjectDetectionTask"
+        "name": "CarlaObjectDetectionTask",
+        "export_batches": true
     },
     "sysconfig": {
         "docker_image": "twosixarmory/armory",

Command used to test this feature:

CUDA_VISIBLE_DEVICES=1 armory run --no-docker --skip-attack --use-gpu --num-eval-batches 1 scenario_configs/eval7/carla_overhead_object_detection/carla_obj_det_adversarialpatch_undefended.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant