Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Matterport mask RCNN Shapes Dataset Demo #849

Merged
merged 1 commit into from
Jun 3, 2019
Merged

Matterport mask RCNN Shapes Dataset Demo #849

merged 1 commit into from
Jun 3, 2019

Conversation

karanchahal
Copy link
Contributor

Hello !

I have been training my datasets on this repo and found it really modular and well coded. However, the data set loading process and training pipeline is not that easy to get into and requires digging into the code. For newcomers that just want to train their dataset, a full end to end demo would be great.

Hence, I've coded a demo that trains on the Matterport's Shapes Dataset and validated it on Google colab. Please let me know what you think!

I've coded it such that the user doesn't not have to go into the code and change files.

The google colab demo link is given here

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 2, 2019
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks a lot!

PS: many of the functions are already present in maskrcnn-benchmark, like non-maximum suppression and box iou and I don't think they need to be duplicated, but those can be improvement on a follow-up PR

@fmassa fmassa merged commit 2c025d9 into facebookresearch:master Jun 3, 2019
@karanchahal
Copy link
Contributor Author

Thank you ! This is my first accepted PR :D

I'll use the repo functions and remove the functions you mentioned in a follow up PR soon.

@GANgstaR0v0t
Copy link

Hi!

@karanchahal, this PR helps me a lot. It can be one solution to train the model changing only one file, very useful for noobs like me. At this moment, I'm trying to merge your ipynb with #521 . Any advice will be greatly appreciated. I'm a little bit loss. Clearly, I don't understand data loading yet.

  • First, I replaced ShapeDataset with COCODataset from coco.py, adding a len method, as suggested in #521:

def __len__(self): return len(self.ids)

  • For first test, it's simpler to not remove the last layers and use the train and val coco dataset, as in the README.

  • Later, I changed the train line:
    model = train(cfg, local_rank=1, distributed=False, dataset=ShapeDataset(500))

for:
model = train(cfg, local_rank=1, distributed=False, dataset=COCODataset(data_json, img_dir, False))
And it gives me this error:

AttributeError: Traceback (most recent call last): File "/home/betegon/.conda/envs/benchmark/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/betegon/maskrcnn_benchmark/maskrcnn_benchmark/data/collate_batch.py", line 17, in __call__ images = to_image_list(transposed_batch[0], self.size_divisible) File "/home/betegon/maskrcnn_benchmark/maskrcnn_benchmark/structures/image_list.py", line 50, in to_image_list max_size = tuple(max(s) for s in zip(*[img.shape for img in tensors])) File "/home/betegon/maskrcnn_benchmark/maskrcnn_benchmark/structures/image_list.py", line 50, in <listcomp> max_size = tuple(max(s) for s in zip(*[img.shape for img in tensors])) AttributeError: 'Image' object has no attribute 'shape'

Thank you so much for your time and any help you can give, and of course kudos to @fmassa for his fantastic work.

Lyears pushed a commit to Lyears/maskrcnn-benchmark that referenced this pull request Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants