1. 09 Nov, 2020 1 commit
  2. 30 Oct, 2020 2 commits
  3. 21 Oct, 2020 2 commits
    • F-G Fernandez's avatar
      Added eps in the __repr__ of FrozenBN (#2852) · 005355bd
      F-G Fernandez authored
      * feat: Updated FrozenBN eps to align with BatchNorm
      
      * feat: Added eps to __repr__ of FrozenBN
      
      * test: Updated unittest of __repr__ for FrozenBN
      
      * test: Updated unittest for eps value in BN and FrozenBN
      
      * fix: Revert FrozenBN eps value
      
      * test: Revert test on eps alignment between FrozenBN and BN
      005355bd
    • F-G Fernandez's avatar
      Added __repr__ to MultiScaleRoIAlign (#2840) · e280f614
      F-G Fernandez authored
      
      
      * feat: Added __repr__ to MultiScaleRoIAlign
      
      * test: Added unittest for __repr__ of MultiScaleRoIAlign
      
      * feat: Added feature map names in __repr__
      
      * test: Updated unittest
      Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
      e280f614
  4. 11 Oct, 2020 1 commit
  5. 07 Oct, 2020 1 commit
  6. 01 Oct, 2020 1 commit
    • Aditya Oke's avatar
      Adds bounding boxes conversion (#2710) · e70c91a9
      Aditya Oke authored
      
      
      * adds boxes conversion
      
      * adds documentation
      
      * adds xywh tests
      
      * fixes small typo
      
      * adds tests
      
      * Remove sphinx theme
      
      * corrects assertions
      
      * cleans code as per suggestion
      Signed-off-by: default avatarAditya Oke <okeaditya315@gmail.com>
      
      * reverts assertion
      
      * fixes to assertEqual
      
      * fixes inplace operations
      
      * Adds docstrings
      
      * added documentation
      
      * changes tests
      
      * moves code to box_convert
      
      * adds more tests
      
      * Apply suggestions from code review
      
      Let's leave those changes to a separate PR
      
      * fixes documentation
      Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
      e70c91a9
  7. 24 Sep, 2020 1 commit
    • Aditya Oke's avatar
      Adds Generalized IOU (#2642) · 6e10e3f8
      Aditya Oke authored
      * tries adding genaralized_iou
      
      * fixes linting
      
      * Adds docs for giou, iou and box area
      
      * fixes lint
      
      * removes docs to fixup in other PR
      
      * linter fix
      
      * Cleans comments
      
      * Adds tests for box area, iou and giou
      
      * typo fix for testCase
      
      * fixes typo
      
      * fixes box area test
      
      * fixes implementation
      
      * updates tests to tolerance
      6e10e3f8
  8. 24 Aug, 2020 1 commit
    • vfdev's avatar
      Fixes crash in deformable convolutions (2598) (#2604) · 8c32666b
      vfdev authored
      * [WIP] Fixes #2598
      - Adjusted num_kernels and batch_size according to kMaxGridNum * CUDA_NUM_THREADS
      - Tests to add
      
      * - Redefined kMaxGridNum as max grid according to current CUDA device
      - Added test to check the code from issue and compared grads CPU/CUDA
      
      * Fixed static kMaxGridNum evaluation to dynamic
      8c32666b
  9. 09 Jul, 2020 1 commit
    • mcarilli's avatar
      [WIP] Allow autocast for 1.6 (#2384) · 0a8586c9
      mcarilli authored
      
      
      * Fixes Xiao's repro
      
      * Ports nms to use full dispatcher
      
      * Move HIPGuard to nms_cuda
      
      * clang-format
      
      * run models in test_models.py on GPU if available
      
      * Francisco's comment, also disable cuda model tests to see if CPU alone still passes
      
      * cuda tests now pass locally, although still not comparing to saved numerics
      
      * add note for thing to ask francisco
      
      * Allow cuda and cpu tests to share a data file
      
      * ignore suffix if unneeded
      
      * Skip autocast numerics checks for a few models
      
      * Add roi_align test
      Co-authored-by: default avatarMichael Carilli <mcarilli@nvidia.com>
      0a8586c9
  10. 01 Jun, 2020 1 commit
  11. 11 May, 2020 2 commits
    • F-G Fernandez's avatar
      Added eps attribute to FrozenBatchNorm2d (#2190) · 7a2d0618
      F-G Fernandez authored
      * feat: Added eps argument to FrozenBatchNorm2d
      
      * test: Added unittest for eps addition in FrozenBatchNorm2d
      
      See #2169
      
      * fix: Reverted forward changes for JIT fuser
      
      * fix: Added back n argument for backward-compatibility
      
      * fix: Fixed FrozenBatchNorm2d forward
      
      Added back eps
      
      * feat: Specified deprecation warnings in FrozenBatchNorm2d
      
      * test: Added unittest for deprecation warninig in FrozenBatchNorm2d
      
      * style: Fixed lint
      
      * style: Fixed block comment lint
      7a2d0618
    • F-G Fernandez's avatar
      fix: Restored support of tuple of Tensors for region pooling ops (#2199) · a09d129c
      F-G Fernandez authored
      * feat: Restored support of tuple of Tensors for roi_align & roi_pool
      
      * test: Added unittest for Tensor sequence support by region pooling
      
      * test: Fixed typo in unittest
      
      * test: Fixed data type
      
      * test: Fixed roi pooling tensor unittest
      
      * test: Fixed box format conversion
      a09d129c
  12. 05 May, 2020 1 commit
    • F-G Fernandez's avatar
      Added number of features in FrozenBatchNorm2d __repr__ (#2168) · 5db8998a
      F-G Fernandez authored
      * feat: Added number of features in FrozenBatchNorm2d repr
      
      While BatchNorm layers have extensive information in their repr, FrozenBatchNorm2d has one
      
      * refactor: Refactored FrozenBatchNorm2d __repr__
      
      * test: Added unittest for FrozenBatchNorm2d __repr__
      
      * style: Removed blank lines in test_ops
      
      * refactor: Avoids creating an extra attribute for __repr__
      
      * style: Switched __repr__ to f-string
      
      Since support of Python version ealier than 3.6 have been dropped, f-string can be used.
      
      * fix: Fixed typo in __repr__
      
      * style: Switched unittest .format to f-string
      5db8998a
  13. 03 Apr, 2020 1 commit
    • Brian Hart's avatar
      improve stability of test_nms_cuda (#2044) · e61538cb
      Brian Hart authored
      * improve stability of test_nms_cuda
      
      This change addresses two issues:
      
      _create_tensors_with_iou() creates test data for the NMS tests. It
      takes care to ensure at least one pair of boxes (1st and last) have
      IoU around the threshold for the test. However, the constructed
      IoU for that pair is _so_ close to the threshold that rounding
      differences (presumably) between CPU and CUDA implementations may
      result in one suppressing a box in the pair and the other not.
      Adjust the construction to ensure the IoU for the box pair is
      near the threshold, but far-enough above that both implementations
      should agree.
      
      Where 2 boxes have nearly or exactly the same score, the CPU and
      CUDA implementations may order them differently. Adjust
      test_nms_cuda() to check only that the non-suppressed box lists
      include the same members, without regard for ordering.
      
      * adjust assertion in test_nms_cuda
      
      The CPU and CUDA nms implementations each sort the box scores
      as part of their work, but the sorts they use are not stable. So
      boxes with the same score maybe be processed in opposite order
      by the two implmentations.
      
      Relax the assertion in test_nms_cuda (following the model in
      pytorch's test_topk()) to allow the test to pass if the output
      differences are caused by similarly-scored boxes.
      
      * improve stability of test_nms_cuda
      
      Adjust _create_tensors_with_iou() to ensure we create at least
      one box just over threshold that should be suppressed.
      e61538cb
  14. 02 Apr, 2020 1 commit
  15. 31 Mar, 2020 1 commit
  16. 13 Mar, 2020 1 commit
  17. 04 Mar, 2020 1 commit
    • AhnDW's avatar
      `aligned` flag in ROIAlign (#1908) · e1e975f9
      AhnDW authored
      * Aligned flag in the interfaces
      
      * Aligned flag in the impl, and remove unused comments
      
      * Handling empty bin in forward
      
      * Remove raise error in roi_width
      
      * Aligned flag in the Testcodes
      e1e975f9
  18. 16 Dec, 2019 1 commit
  19. 04 Dec, 2019 1 commit
    • pedrofreire's avatar
      Add Deformable Convolution operation. (#1586) · 52b8685b
      pedrofreire authored
      * Add Deformable Convolution operation.
      
      This adds the deformable convolution operation, as described in Deformable Convolutional Networks (https://arxiv.org/abs/1703.06211).
      
      - The code is based on https://github.com/open-mmlab/mmdetection/blob/master/mmdet/ops/dcn/src/deform_conv_cuda.cpp ; the whole code was modified and refactored to remove redundancies and increase clarity, and to adapt it to torchvision.
      
      - The CPU part is a direct copy of the CUDA code; it might make sense to do follow-up adjustments in the CPU code to simplify it / optimize it, or to reuse functionality between CPU and CUDA..
      
      - We also add tests (with a non-trivial set of parameters); they can be made more robust by randomizing the parameters and executing multiple times.
      
      * Update DeformConv to be more consistent w/ Conv2d
      
      * rename some variables and arguments to match Conv2d;
      * add optional bias;
      * add weight, offset and bias as module parameters;
      * remove the n_parallel_imgs parameter;
      * Fix __repr__;
      * etc..
      
      Initialization of weight and bias is the same as in Conv2d, and
      initialization of offsets to zero is the same as in the paper.
      
      This also includes some other small unrelated fixes/improvements.
      
      * Apply clang-format in DeformConv files.
      
      * Import Optional type annotation
      
      * Remove offset param from DeformConv2d module
      
      - We pass the offset in the forward of DeformConv2d, instead of having
      an internal parameter. This adds some complexity to creating the module
      (e.g. now you have to worry about the output size, to create the
      offset), but it gives more flexibility.
      - We also use make_tuple for tuple creation, in an attempt to fix error
      w/ older compilers.
      
      * Replace abs by std::abs
      
      Old gcc versions were giving wrong results here, because they would
      resolve abs as int -> int, thus causing undesired truncation. Replacing
      abs by std::abs should allow for correct overloading of abs as float -> float.
      
      * Reorder declarations for clarity
      
      * Reorder weight and offset args in deform_conv2d
      
      We place offset arg before the weight arg, to be more
      consistent with DeformConv2d.forward(input, offset)
      
      * Replace abs by std::abs in DeformConv_cuda
      52b8685b
  20. 25 Nov, 2019 1 commit
    • eellison's avatar
      Make maskrcnn scriptable (#1407) · d88d8961
      eellison authored
      * almost working...
      
      * respond to comments
      
      * add empty tensor op, handle different output types in generalized rcnn
      
      * clean ups
      
      * address comments
      
      * more changes
      
      * it's working!
      
      * torchscript bugs
      
      * add script/ eager test
      
      * eval script model
      
      * fix flake
      
      * division import
      
      * py2 compat
      
      * update test, fix arange bug
      
      * import division statement
      
      * fix linter
      
      * fixes
      
      * changes needed for JIT master
      
      * cleanups
      
      * remove imagelist_to
      
      * requested changes
      
      * Make FPN backwards-compatible and torchscript compatible
      
      We remove support for feature channels=0, but support for it was already a bit limited
      
      * Fix ONNX regression
      d88d8961
  21. 06 Nov, 2019 1 commit
    • pedrofreire's avatar
      Simplify and organize test_ops. (#1551) · af225a8a
      pedrofreire authored
      * Simlify and organize test_ops.
      
      We perform the following:
      
      - Simplify the functions slow_roi_pooling, slow_ps_roi_pooling, slow_ps_roi_align and bilinear_interpolate (including finding and removing a semi-bug in slow_ps_roi_pooling, which used bin_w instead of bin_h);
      - Wrote a slow_roi_align function, that was missing;
      - Create a base class testing all combinations of forward/backward, cpu/cuda, contiguous/non-contiguous;
      - Organize all testing inside the base class with _test_forward and _test_backward (which can be easily overriden if a parciular op needs something different); an Op class then only needs to implement fn, get_script_fn, and expected_fn.
      
      A few points:
      - We are using the same inputs for all tests, and not trying all possible inputs in the domain of a given operation. One improvement would be to test more diverse inputs, and to personalize the inputs for some ops (e.g. different inputs for pooling ops and align ops).
      - Running all tests is quite slow (~1 min only for CPU tests), so that can possibly be improved.
      
      * Reduce input size used in gradcheck.
      
      gradcheck can be quite costly, and it was causing OOM errors and making
      the tests slow. By reducing the size of the input, the test speed is
      down to 3 seconds for the CPU tests.
      
      Other points:
      - We remove an unused namedtuple;
      - We inherit from object for better Python 2 compatibility;
      - We remove a hardcoded pool_size from the TorchScript functions, and
      add it as a parameter instead.
      
      * Replace Tensor by torch.Tensor in type annotations.
      
      This should fix lint errors.
      af225a8a
  22. 05 Nov, 2019 1 commit
  23. 21 Oct, 2019 1 commit
  24. 16 Oct, 2019 1 commit
  25. 18 Sep, 2019 1 commit
    • Francisco Massa's avatar
      Remove cpp extensions in favor of torch ops (#1348) · f677ea31
      Francisco Massa authored
      * Remove C++ extensions in favor of custom ops
      
      * Remove unused custom_ops.cpp file
      
      * Rename _custom_ops.py
      
      * Reorganize functions
      
      * Minor improvements and fixes
      
      * Fix lint
      
      * Fully scriptable ops
      
      * Import types used by annotations
      f677ea31
  26. 10 Sep, 2019 1 commit
    • Thomas Viehmann's avatar
      Make custom ops differentiable (#1314) · a91fe722
      Thomas Viehmann authored
      * Make custom ops differentiable
      
      and replace autograd.Function. Use ops unconditionally.
      
      We may consider removing the extension functions in a follow-up.
      
      The code-path is tested by the exisitng tests for differentiability.
      
      * add scripting gradchecks tests and use intlist
      
      * fix implicit tuple conversion for gcc-5
      
      * fix merge
      a91fe722
  27. 14 Jun, 2019 1 commit
  28. 19 May, 2019 1 commit
  29. 07 May, 2019 1 commit
    • Francisco Massa's avatar
      Add C++ ops to torchvision (#826) · dc3ac290
      Francisco Massa authored
      * Initial layout for layers with cpp extensions
      
      * Move files around
      
      * Fix import after move
      
      * Add support for multiple types to ROIAlign
      
      * Different organization
      
      CUDA extensions work now
      
      * Cleanups
      
      * Reduce memory requirements for backwards
      
      * Replace runtime_error by AT_ERROR
      
      * Add nms test
      
      * Add support for compilation using CPP extensions
      
      * Change folder structure
      
      * Add ROIPool cuda
      
      * Cleanups
      
      * Add roi_pool.py
      
      * Fix lint
      
      * Add initial structures folder for bounding boxes
      
      * Assertion macros compatible with pytorch master (#540)
      
      * Support for ROI Pooling (#592)
      
      * ROI Pooling with tests. Fix for cuda context in ROI Align.
      
      * renamed bottom and top to follow torch conventions
      
      * remove .type().tensor() calls in favor of the new approach to tensor initialization (#626)
      
      * Consistent naming for rois variable (#627)
      
      * remove .type().tensor() calls in favor of the new approach to tensor initialization
      
      * Consistent naming for rois variable in ROIPool
      
      * ROIPool: Support for all datatypes (#632)
      
      * Use of torch7 naming scheme for ROIAlign forward and backward
      
      * use common cuda helpers in ROIAlign
      
      * use .options() in favor of .type() where applicable
      
      * Added tests for forward pass of ROIAlign, as well as more consistent naming scheme for CPU vs CUDA
      
      * working ROIAlign cuda backwards pass
      
      * working ROIAlign backwards pass for CPU
      
      * added relevant headers for ROIAlign backwards
      
      * tests for ROIAlign layer
      
      * replace .type() with .options() for tensor initialization in ROIAlign layers
      
      * support for Half types in ROIAlign
      
      * gradcheck tests for ROIAlign
      
      * updated ROIPool on CPU to work with all datatypes
      
      * updated and cleaned tests for ROI Pooling
      
      * Fix rebase problem
      
      * Remove structures folder
      
      * Improve cleanup and bugfix in test_layers
      
      * Update C++ headers
      
      * Add CUDAGuard to cu files
      
      * Add more checks to layers
      
      * Add CUDA NMS and tests
      
      * Add multi-type support for NMS CUDA
      
      * Avoid using THCudaMalloc
      
      * Add clang-format and reformat c++ code
      
      * Remove THC includes
      
      * Rename layers to ops
      
      * Add documentation and rename functions
      
      * Improve the documentation a bit
      
      * Fix some lint errors
      
      * Fix remaining lint inssues
      
      * Area computation doesn't add +1 in NMS
      
      * Update CI to use PyTorch nightly
      
      * Make NMS return indices sorted according to the score
      
      * Address reviewer comments
      
      * Lint fixes
      
      * Improve doc for roi_align and roi_pool
      
      * move to xenial
      
      * Fix bug pointed by @lopuhin
      
      * Fix RoIPool reference implementation in Python 2
      
      Also fixes a bug in the clip_boxes_to_image -- this function needs a test!
      
      * Remove change in .travis
      dc3ac290