pytorch / pytorch/tutorials

Mask-RCNN tutorial one-line change suggestion

Open
#960 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

easy torchvision
Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

I would like to suggest changing the labels in Mask-RCNN tutorial from

labels = torch.ones((num_objs,), dtype=torch.int64)

to the following:

label = torch.as_tensor(obj_ids, dtype=torch.int64)

that will work if there are more than 2 types of object instances (num_objs) in the image. In fact, the new form will give the same exact vector of labels = torch.ones((num_objs,), dtype=torch.int64) and will work for any number of object instances. I have tried it with a dataset containing 60 object instances and all went well.

Kind regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the Mask-RCNN tutorial linked in the issue and locate the labels assignment containing torch.ones. Replace it with the suggested obj_ids-based assignment, then verify that the tutorial's example still uses the resulting labels for datasets with multiple object instances.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.