Skip to content

Improved Fast RCNN tutorial #914

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

Merged
merged 2 commits into from
Mar 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion intermediate_source/torchvision_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ should return:
- ``boxes (FloatTensor[N, 4])``: the coordinates of the ``N``
bounding boxes in ``[x0, y0, x1, y1]`` format, ranging from ``0``
to ``W`` and ``0`` to ``H``
- ``labels (Int64Tensor[N])``: the label for each bounding box
- ``labels (Int64Tensor[N])``: the label for each bounding box. ``0`` represents always the background class.
- ``image_id (Int64Tensor[1])``: an image identifier. It should be
unique between all the images in the dataset, and is used during
evaluation
Expand All @@ -56,6 +56,8 @@ If your model returns the above methods, they will make it work for both
training and evaluation, and will use the evaluation scripts from
``pycocotools``.

One note on the ``labels``. The model considers class ``0`` as background. If your dataset does not contain the background class, you should not have ``0`` in your ``labels``. For example, assuming you have just two classes, *cat* and *dog*, you can define ``1`` (not ``0``) to represent *cats* and ``2`` to represent *dogs*. So, for instance, if one of the images has booth classes, your ``labels`` tensor should look like ``[1,2]``.

Additionally, if you want to use aspect ratio grouping during training
(so that each batch only contains images with similar aspect ratio),
then it is recommended to also implement a ``get_height_and_width``
Expand Down