1. 17 May, 2021 1 commit
  2. 11 May, 2021 1 commit
  3. 10 May, 2021 1 commit
  4. 08 Apr, 2021 1 commit
    • Nicolas Hug's avatar
      Add Quantized version of RoIAlign (#3624) · ad9cc62a
      Nicolas Hug authored
      * WIP
      
      * clang
      
      * docs
      
      * extracted out common utils
      
      * Use better quantization function and pass tensors as parameters
      
      * proper dequantization
      
      * Some tests
      
      * Dequantization optimization, seems to gain a few ms
      
      * clang-format
      
      * again
      
      * more correct test. Had to remove optimization although it almost works
      
      * Also test aligned=True
      
      * remove useless part
      
      * more docs and comments
      
      * Put back optimization with more robust test
      
      * Added check for index upper bound
      
      * avoid possible overflow
      
      * Move common function into common.h
      
      * oops
      
      * scale=1,zero_point=0 makes more sense
      
      * Force batch size of 1 to prevent any indexingbug
      
      * format
      
      * format again
      
      * updated docstring
      
      * put back description comment for pre_calc_bilinear_interpolate
      
      * revert most changes to docstring as it's taken care of in another PR
      ad9cc62a
  5. 30 Mar, 2021 1 commit
    • Nicolas Hug's avatar
      Add quantized version of nms (#3601) · f74bfab6
      Nicolas Hug authored
      * Add quantized version of nms
      
      * Added tests
      
      * Compute areas only once
      
      * remove calls to dequantize_val
      
      * fix return type for empty tensor
      
      * flake8
      
      * remove use of scale as it gets cancelled out
      
      * simpler int convertion in tests
      
      * explicitly set ovr to double
      
      * add tests for more values of scale and zero_point
      
      * comment about underflow
      
      * remove unnecessary accessor
      
      * properly convert to float for division
      
      * Add comments about underflow
      
      * explicitely cast coordinates to float to allow vectorization
      
      * clang
      
      * clang  again
      
      * hopefully OK now
      f74bfab6
  6. 10 Mar, 2021 2 commits
  7. 08 Mar, 2021 1 commit
    • Nicolas Hug's avatar
      [OPS, IMP] New batched_nms implementation (#3426) · 414427dd
      Nicolas Hug authored
      
      
      * new batched_nms implem
      
      * flake8
      
      * hopefully fix torchscipt tests
      
      * Use where instead of nonzero
      
      * Use same threshold (4k) for CPU and GPU
      
      * Remove use of argsort
      
      * use views again
      
      * remove print
      
      * trying stuff, I don't know what's going on
      
      * previous passed onnx checks so the error isn't in _vanilla func. Trying to return vanilla now
      
      * add tracing decorators
      
      * cleanup
      
      * wip
      
      * ignore new path with ONNX
      
      * use vanilla if tracing...????
      
      * Remove script_if_tracing decorator as it was conflicting with _is_tracing
      
      * flake8
      
      * Improve coverage
      Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
      414427dd
  8. 15 Feb, 2021 1 commit
  9. 28 Jan, 2021 1 commit
  10. 04 Jan, 2021 1 commit
    • Vasilis Vryniotis's avatar
      Speed up CI runtime (#3189) · 4d2d8bb0
      Vasilis Vryniotis authored
      * Speedup test_ucf101 (#2623 
      
      * Speedup Cmake builds (#3186)
      
      * Speedup test_autoaugment (#3190)
      
      * Speedup DeformConvTester (#3191)
      
      * Speedup InceptionV3 and GoogleNet on Windows (#3196)
      4d2d8bb0
  11. 15 Dec, 2020 1 commit
  12. 11 Dec, 2020 1 commit
  13. 27 Nov, 2020 1 commit
  14. 09 Nov, 2020 1 commit
  15. 30 Oct, 2020 2 commits
  16. 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
  17. 11 Oct, 2020 1 commit
  18. 07 Oct, 2020 1 commit
  19. 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
  20. 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
  21. 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
  22. 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
  23. 01 Jun, 2020 1 commit
  24. 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
  25. 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
  26. 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
  27. 02 Apr, 2020 1 commit
  28. 31 Mar, 2020 1 commit
  29. 13 Mar, 2020 1 commit
  30. 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
  31. 16 Dec, 2019 1 commit
  32. 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
  33. 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
  34. 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
  35. 05 Nov, 2019 1 commit
  36. 21 Oct, 2019 1 commit