-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add VOC Detection and Segmentation Datasets #86
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
Conversation
def __getitem__(self, index): | ||
img_id = self.ids[index] | ||
|
||
target = Image.open(self._annopath % img_id).convert('RGB') |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
"""VOC Segmentation Dataset Object | ||
input and target are both images | ||
|
||
NOTE: need to address https://github.com/pytorch/vision/issues/9 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
When do you merge this pull request... |
(default: alphabetic indexing of VOC's 20 classes) | ||
keep_difficult (bool, optional): keep difficult instances or not | ||
(default: False) | ||
channels (int): number of channels |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
for i, cur_bb in enumerate(bbox): | ||
bb_sz = int(cur_bb.text) - 1 | ||
# scale height or width | ||
bb_sz = bb_sz / width if i % 2 == 0 else bb_sz / height |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
targets = [] | ||
imgs = [] | ||
for _, sample in enumerate(batch): | ||
for _, tup in enumerate(sample): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
label_ind = self.class_to_ind[name] | ||
bndbox.append(label_ind) | ||
res += [bndbox] # [xmin, ymin, xmax, ymax, ind] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Replaced by #663 Thanks for the PR! |
took what @fmassa left off with at https://github.com/pytorch/examples/pull/21/files#diff-0344e770fabb635e92d12f8b67f3504a and completed / improved