"examples/git@developer.sourcefind.cn:change/sglang.git" did not exist on "acd1a15921f7405d611a607fee73274d8e77bedc"
Commit 1c35e46c authored by Georgy Marrero's avatar Georgy Marrero Committed by Facebook GitHub Bot
Browse files

Add d2go data registry support for v2 mask paths

Summary:
# context

Right now, when we register Person or Hair data we have a mask directory with .PNGs inside and when we register MCS data we have multiple directories <class>_mask. These are 2 separate file structures to maintain.

# this diff

**This diff is to add support for the following file structure for *both* Multi-Class and Single-Class Semantic Segmentation:**

```
mask/
  person/
  hair/
  skin/
  beard/
  clothes/
```

**without breaking the previous format for Single-Class Semantic Segmentation (`mask/` with .PNGs).**

# why?

With this change, we'll be able to prepare data once (create the file structure and d2go coco jsons) and make it ready-to-be-registered for Single-Class Semantic Segmentation (Person or Hair) and Multi-Class Segmentation.

We'll save on having to prepare the dataset 3 times and managing multiple copies of the same images and annotations. There will be one source of truth. For UGC, we'll be able to enforce privacy deletions with less complications.

Also, this is the format used in the Video Eval tool. So data prepared for training can be used for video evaluation if needed and data prepared for video evaluation can easily be prepared for training.

# to dos:

- ~~Add the v2 path support on the Single-Class Segmentation's `SemSegEvaluator` so that the v2 format can be used for evaluation (sync with wat3rBro for best way to do this)~~
  - **Done.** This happens automatically given the the Single-Class case in the `MultiSemSegEvaluator` class doesn't re-register the datasets. See the first job for an example.

Reviewed By: wat3rBro

Differential Revision: D26795469

fbshipit-source-id: 6ebbb1a430c049dad361d56842a587c76926ee23
parent e5d6db2f
...@@ -82,7 +82,7 @@ class MultiSemSegEvaluator(DatasetEvaluator): ...@@ -82,7 +82,7 @@ class MultiSemSegEvaluator(DatasetEvaluator):
image_root=metadata.image_root, image_root=metadata.image_root,
sem_seg_root=metadata.sem_seg_root, sem_seg_root=metadata.sem_seg_root,
instances_json=metadata.json_file, instances_json=metadata.json_file,
mask_dir="{}_mask".format(superclass_name), mask_dir=metadata.mask_dir.format(superclass_name),
) )
self.evaluators[key] = create_evaluator_and_reset(tmp_dataset_name) self.evaluators[key] = create_evaluator_and_reset(tmp_dataset_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment