8000 [Completed][PyTorch] Add Anchor Boxes by suvaansh · Pull Request #1312 · d2l-ai/d2l-en · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Completed][PyTorch] Add Anchor Boxes #1312

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

Closed
wants to merge 35 commits into from
Closed

[Completed][PyTorch] Add Anchor Boxes #1312

wants to merge 35 commits into from

Conversation

suvaansh
Copy link
@suvaansh suvaansh commented Aug 8, 2020

Description of changes:

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

@mli
Copy link
Member
mli commented Aug 8, 2020

Job d2l-en/PR-1312/7 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1312/

Copy link
Member
@AnirudhDagar AnirudhDagar left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Please see the contribution guidelines.
Use d2lbook to save functions in d2l/torch.py. No need to edit that manually.
Follow implementation closer to mx wherever possible. Save or define explicit functions for pytorch if necessary.

chapter_computer-vision/anchor.md Outdated Show resolved Hide resolved
@suvaansh suvaansh requested a review from AnirudhDagar August 9, 2020 20:56
8000
@mli
Copy link
Member
mli commented Aug 10, 2020

Job d2l-en/PR-1312/17 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1312/

@suvaansh suvaansh changed the title [PyTorch] Add Anchor Boxes [WIP][PyTorch] Add Anchor Boxes Aug 13, 2020
@mli
Copy link
Member
mli commented Aug 15, 2020

Job d2l-en/PR-1312/35 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1312/

@suvaansh suvaansh changed the title [WIP][PyTorch] Add Anchor Boxes [Completed][PyTorch] Add Anchor Boxes Aug 15, 2020
@mli
Copy link
Member
mli commented Aug 15, 2020

Job d2l-en/PR-1312/36 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1312/

@suvaansh
Copy link
Author

Hi @AnirudhDagar Can you please review the changes made as suggested by you. Thanks

Copy link
Member
@AnirudhDagar AnirudhDagar left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @suvaansh! Overall LGTM!

Made a few comments PTAL and update the PR.

When you finish a section, just save the notebook.
then run

  1. d2lbook activate all chapter_computer-vision/anchor.md
  2. d2lbook build lib
    This will activate all the tabs and then copy the saved functions to the respective libraries.
    You need to commit and push updated d2l/torch.py file along with this markdown file.

Comment on lines +122 to +124
def bbox_to_rect(bbox, color):
"""Convert bounding box to matplotlib format."""
return d2l.plt.Rectangle(xy=(bbox[0], bbox[1]), width=bbox[2]-bbox[0], height=bbox[3]-bbox[1], fill=False, edgecolor=color, linewidth=2)
Copy link
Member

Choose a reason for hiding this comment

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

This method is defined in bounding-box.md
We save it there and use it here.

Similarly for other methods.

Copy link
Member

Choose a reason for hiding this comment

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

I added it here.

```{.python .input}
#@tab pytorch
#@save
def multibox_prior(feature_map_sizes, sizes, aspect_ratios):
Copy link
Member

Choose a reason for hiding this comment

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

Here it is right that you define this function because torch/torchvision don't offer a built-in method for multibox_prior like mxnet.multibox prior

#@save
PredBoundingBox = namedtuple("PredBoundingBox", ["probability", "class_id", "classname", "bounding_box"])

def non_max_suppression(bounding_boxes: list, iou_threshold: float = 0.1) -> list:
Copy link
Member

Choose a reason for hiding this comment

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

nms not possible through torchvision.ops?

@suvaansh
Copy link
Author

This PR has become a mess. So, I am creating a new PR for the same and closing this. It contains all the changes suggested above. Thanks

@suvaansh suvaansh closed this Aug 17, 2020
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

Successfully merging this pull request may close these issues.

3 participants
0