pytorch / tutorials

PyTorch tutorials.
https://pytorch.org/tutorials/
BSD 3-Clause "New" or "Revised" License
8.27k stars 4.07k forks source link

Mask-RCNN tutorial one-line change suggestion #960

Open morawi opened 4 years ago

morawi commented 4 years ago

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

ver2king commented 1 year ago

/assigntome

ver2king commented 1 year ago

Regarding this issue, I only found a .html file when forking the repo that is relevant to the issue. Therefore, I safely assume that I shall fix that .html file?

svekars commented 1 year ago

This unfortunately won't work. We'll give half credit for the PR but it should not be merged.

ver2king commented 1 year ago

@svekars As you can see from the original issue (#960), that is the only issue that needs to be changed. May you request what needs to be adjusted to "work"?

engichang1467 commented 10 months ago

@svekars and @morawi I'd like to know if this is still an unresolved issue. If so, then I'd like to work on it 😊

engichang1467 commented 10 months ago

/assigntome

morawi commented 10 months ago

@svekars and @morawi I'd like to know if this is still an unresolved issue. If so, then I'd like to work on it 😊 From what I remember: I have tried this change with some other datasets, but not the PennFudan dataset. So, it is not working for the PennFudan for a reason. If @engichang1467 want to give it a try, I suggest trying it with some other datasets, then investigating why is it not working for the PennFudan, as outlined by @svekars.