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

Link to the "converted mask annotation" is not working #132

Open
codefortheplanet opened this issue Apr 27, 2023 · 8 comments
Open

Link to the "converted mask annotation" is not working #132

codefortheplanet opened this issue Apr 27, 2023 · 8 comments

Comments

@codefortheplanet
Copy link

Hello, the link to the "converted mask annotation" is not working. Could you update the link or is there another way I can download it? Thank you.

@lkeab
Copy link
Owner

lkeab commented May 8, 2023

Hi, it seems some bugs with onedrive. I provide another google drive link here.

@codefortheplanet
Copy link
Author

Hi, Thanks for the link. The annotation file in google drive looks corrupt and is incomplete. Could you try to zip it before uploading? Thank you!

@lkeab
Copy link
Owner

lkeab commented Jun 10, 2023

@codefortheplanet
Copy link
Author

Thanks for reuploading. However, the new file is still not working. Here is the print out message and this is exactly what happened for your previous version. The JSON string is incomplete.

Traceback (most recent call last):
File "tools/train_net.py", line 161, in
args=(args,),
File "/home/rocks/model/bcnet/BCNet/detectron2/engine/launch.py", line 51, in launch
main_func(*args)
File "tools/train_net.py", line 143, in main
trainer = Trainer(cfg)
File "/home/rocks/model/bcnet/BCNet/detectron2/engine/defaults.py", line 246, in init
data_loader = self.build_train_loader(cfg)
File "/home/rocks/model/bcnet/BCNet/detectron2/engine/defaults.py", line 420, in build_train_loader
return build_detection_train_loader(cfg)
File "/home/rocks/model/bcnet/BCNet/detectron2/data/build.py", line 306, in build_detection_train_loader
proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None,
File "/home/rocks/model/bcnet/BCNet/detectron2/data/build.py", line 226, in get_detection_dataset_dicts
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in dataset_names]
File "/home/rocks/model/bcnet/BCNet/detectron2/data/build.py", line 226, in
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in dataset_names]
File "/home/rocks/model/bcnet/BCNet/detectron2/data/catalog.py", line 61, in get
return f()
File "/home/rocks/model/bcnet/BCNet/detectron2/data/datasets/register_coco.py", line 33, in
DatasetCatalog.register(name, lambda: load_coco_json(json_file, image_root, name))
File "/home/rocks/model/bcnet/BCNet/detectron2/data/datasets/coco.py", line 226, in load_coco_json
coco_api = COCO(json_file)
File "/home/rocks/anaconda3/envs/bcnet3/lib/python3.7/site-packages/pycocotools-2.0-py3.7-linux-x86_64.egg/pycocotools/coco.py", line 84, in init
dataset = json.load(open(annotation_file, 'r'))
File "/home/rocks/anaconda3/envs/bcnet3/lib/python3.7/json/init.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/home/rocks/anaconda3/envs/bcnet3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/rocks/anaconda3/envs/bcnet3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/rocks/anaconda3/envs/bcnet3/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 650681102 (char 650681101)

@codefortheplanet
Copy link
Author

@lkeab Could you zip the file first and then upload it again! Thank you very much!

@r-kanke
Copy link

r-kanke commented Jul 10, 2023

I followed the process.sh in README.md to make a bilayer mask annotation and it worked for me.

$ python -m detectron2.data.datasets.process_dataset datasets/coco/annotations/instances_train2017.json datasets/coco/train2017 coco_ 2017_train
$ mv ann.json datasets/coco/annotations/instances_train2017_bcnet.json

@qgq99
Copy link

qgq99 commented Oct 25, 2023

@lkeab Could you zip the file first and then upload it again! Thank you very much!

Hi, I am suffering the same problem, have you solved it?

@qgq99
Copy link

qgq99 commented Oct 26, 2023

sorry I updated it again: https://drive.google.com/file/d/1F2ClhTH5vZNlYvAqQhFQ3TVAbfbYp02y/view?usp=sharing

Hi, I've done the two steps as #132 (comment), but I still suffer the same problem as #132 (comment), and then I checked the tail content of the file downloaded from the url you provided:#132 (comment), I found there is something wrong with the json file. I use the following code to check the content:

file_path = r"path to\instances_train_2017_transform_slight_correct.json"

if __name__ == '__main__':
    with open(file_path) as f:
        print(f.read()[-100:])

the output is:

.54, 112.44, 624.54, 123.11, 624.54, 129.52, 625.97, 129.52, 634.51, 131.65, 640.0, 139.48, 640.0, 1

It seems that it lacks a '}' or the content is incomplete. So could you please update the file and provide the url again? Thank you!

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

4 participants