Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing data for Amodal Segmentation #88

Closed
jitaxis opened this issue Mar 16, 2022 · 4 comments
Closed

Preparing data for Amodal Segmentation #88

jitaxis opened this issue Mar 16, 2022 · 4 comments

Comments

@jitaxis
Copy link

jitaxis commented Mar 16, 2022

Hi,

I currently have images annotated in the COCO format, which from my understanding is correct for the conversion used by BCNet?
When I try to run the line from process.sh, I get the following error:
File "/content/BCNet/detectron2/data/datasets/process_dataset.py", line 17, in
from .. import MetadataCatalog, DatasetCatalog
ImportError: attempted relative import with no known parent package

Also, I am trying to use BCNet on Google Colab.

Please let me know what I am doing or have done wrong and any further guidance is greatly appreciated.

@lkeab
Copy link
Owner

lkeab commented Mar 16, 2022

You could refer to the discussion here, which may be related with the python versions.

@jitaxis
Copy link
Author

jitaxis commented Mar 16, 2022

I think I realised what I did wrong. I am using @Shadercloud version from this issue #81 (comment)_

Therefore I didn't build the main BCNet repo, which means the packages were not found.

But when trying to run the same script from @Shadercloud version, I get the following error.

File "/content/detectron2/detectron2/data/datasets/process_dataset.py", line 575, in
assert sys.argv[3] in DatasetCatalog.list()
AssertionError

Which makes me think I am somehow passing my arguments incorrectly. An example of the line I am executing is below:

!python -m detectron2.data.datasets.process_dataset "/content/drive/Shareddrives/Collected Data/training_anno_images.json" "/content/drive/Shareddrives/Folder For Datasets/datasets/training_image_folder" "New_Name"

Side question:
For Amodal segmentation, does my training dataset have to be all not occluded images?

@lkeab
Copy link
Owner

lkeab commented Mar 18, 2022

For the fist question, the "new_name" should be registered in the config file, you could follow the way of "coco_2017_train".
For the side question, no.

@lkeab lkeab closed this as completed Mar 18, 2022
@jitaxis
Copy link
Author

jitaxis commented Mar 21, 2022

So I have tried to register my coco annotated dataset using the following code:

train_json_annot_path = "/content/drive/Shareddrives/Collected Data/training_anno_images.json"
train_images_path = "/content/drive/Shareddrives/Folder For Datasets/datasets/training_image_folder"
train_dataset_name = "Name_train"

register_coco_instances(name = train_dataset_name,metadata={},json_file=train_json_annot_path,image_root=train_images_path)

!python -m detectron2.data.datasets.process_dataset train_json_annot_path train_images_path train_dataset_name

I still get the output:

File "/content/detectron2/detectron2/data/datasets/process_dataset.py", line 575, in
assert sys.argv[3] in DatasetCatalog.list()
AssertionError

Is this what you mean by "follow the way of "coco_2017_train"". If not could you please direct me more to solve this issue.
Thank you for all the help.

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

No branches or pull requests

2 participants