"server/text_generation/utils.py" did not exist on "f16f2f5ae15a1b728559e1ac1a8b840f15a54efd"
  1. 19 May, 2020 1 commit
  2. 18 May, 2020 2 commits
    • Steven Basart's avatar
      Add pil_to_tensor to functionals (#2092) · e6d3f8c5
      Steven Basart authored
      * Adds as_tensor to functional.py
      
      Similar functionality to to_tensor without the default conversion to float and division by 255.
      Also adds support for Image mode 'L'.
      
      * Adds tests to AsTensor()
      
      Adds tests to AsTensor and removes the conversion to float and division by 255.
      
      * Adds AsTensor to transforms.py
      
      Calls the as_tensor function in functionals and adds the function AsTensor as callable from transforms.
      
      * Removes the pic.mode == 'L'
      
      This was handled by the else condition previously so I'll remove it.
      
      * Fix Lint issue
      
      Adds two line breaks between functions to fix lint issue
      
      * Replace from_numpy with as_tensor
      
      Removes the extra if conditionals and replaces from_numpy with as_tensor.
      
      * Renames as_tensor to pil_to_tensor
      
      Renames the function as_tensor to pil_to_tensor and narrows the scope of the function.  At the same time also creates a flag that defaults to True for swapping to the channels first format.
      
      * Renames AsTensor to PILToImage
      
      Renames the function AsTensor to PILToImage and modifies the description.  Adds the swap_to_channelsfirst boolean variable to indicate if the user wishes to change the shape of the input.
      
      * Add the __init__ function to PILToTensor 
      
      Add the __init__ function to PILToTensor since it contains the swap_to_channelsfirst parameter now.
      
      * fix lint issue
      
      remove trailing white space
      
      * Fix the tests
      
      Reflects the name change to PILToTensor and the parameter to the function as well as the new narrowed scope that the function only accepts PIL images.
      
      * fix tests
      
      Instead of undoing the transpose just create a new tensor and test that one.
      
      * Add the view back
      
      Add img.view(pic.size[1], pic.size[0], len(pic.getbands())) back to outside the if condition.
      
      * fix test
      
      fix conversion from torch tensor to PIL back to torch tensor.
      
      * fix lint issues
      
      * fix lint
      
      remove trailing white space
      
      * Fixed the channel swapping tensor test
      
      Torch tranpose operates differently than numpy transpose.  Changed operation to permute.
      
      * Add mode='F'
      
      Add mode information when converting to PIL Image from Float Tensor.
      
      * Added inline comments to follow shape changes
      
      * ToPILImage converts FloatTensors to uint8
      
      * Remove testing not swapping
      
      * Removes the swap_channelsfirst parameter
      
      Makes the channel swapping the default behavior.
      
      * Remove the swap_channelsfirst argument
      
      Remove the swap_channelsfirst argument and makes the swapping the default functionality.
      e6d3f8c5
    • Francisco Massa's avatar
      Fix Python lint (#2226) · e2e511be
      Francisco Massa authored
      e2e511be
  3. 15 May, 2020 1 commit
    • Urwa Muaz's avatar
      Feat/unfreeze layers fpn backbone (#2160) · 348dd5a7
      Urwa Muaz authored
      * freeze layers only if pretrained backbone is used
      
      If pretrained backbone is not used and one intends to train the entire network from scratch, no layers should be frozen.
      
      * function argument to control the trainable features
      
      Depending on the size of dataset one might want to control the number of tunable parameters in the backbone, and this parameter in hyper parameter optimization for the dataset. It would be nice to have this function support this.
      
      * ensuring tunable layer argument is valid
      
      * backbone freezing in fasterrcnn_resnet50_fpn
      
      Handle backbone freezing in fasterrcnn_resnet50_fpn function rather than the resnet_fpn_backbone function that it uses to get the backbone.
      
      * remove layer freezing code
      
      layer freezing code has been moved to fasterrcnn_resnet50_fpn function that consumes resnet_fpn_backbone function.
      
      * correcting linting errors
      
      * correcting linting errors
      
      * move freezing logic to resnet_fpn_backbone
      
      Moved layer freezing logic to resnet_fpn_backbone with an additional parameter.
      
      * remove layer freezing from fasterrcnn_resnet50_fpn
      
      Layer freezing logic has been moved to resnet_fpn_backbone. This function only ensures that the all layers are made trainable if pretrained models are not used.
      
      * update example resnet_fpn_backbone docs
      
      * correct typo in var name
      
      * correct indentation
      
      * adding test case for layer freezing in faster rcnn
      
      This PR adds functionality to specify the number of trainable layers while initializing the faster rcnn using fasterrcnn_resnet50_fpn function. This commits adds a test case to test this functionality.
      
      * updating layer freezing condition for clarity
      
      More information in PR
      
      * remove linting errors
      
      * removing linting errors
      
      * removing linting errors
      348dd5a7
  4. 14 May, 2020 1 commit
  5. 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
  6. 07 May, 2020 1 commit
    • Negin Raoof's avatar
      [ONNX] Fix model export for images w/ no detection (#2126) · 3ac864dc
      Negin Raoof authored
      * Fixing nms on boxes when no detection
      
      * test
      
      * Fix for scale_factor computation
      
      * remove newline
      
      * Fix for mask_rcnn dynanmic axes
      
      * Clean up
      
      * Update transform.py
      
      * Fix for torchscript
      
      * Fix scripting errors
      
      * Fix annotation
      
      * Fix lint
      
      * Fix annotation
      
      * Fix for interpolate scripting
      
      * Fix for scripting
      
      * refactoring
      
      * refactor the code
      
      * Fix annotation
      
      * Fixed annotations
      
      * Added test for resize
      
      * lint
      
      * format
      
      * bump ORT
      
      * ort-nightly version
      
      * Going to ort 1.1.0
      
      * remove version
      
      * install typing-extension
      
      * Export model for images with no detection
      
      * Upgrade ort nightly
      
      * update ORT
      
      * Update test_onnx.py
      
      * updated tests
      
      * Updated tests
      
      * merge
      
      * Update transforms.py
      
      * Update cityscapes.py
      
      * Update celeba.py
      
      * Update caltech.py
      
      * Update pkg_helpers.bash
      
      * Clean up
      
      * Clean up for dynamic split
      
      * Remove extra casts
      
      * flake8
      3ac864dc
  7. 05 May, 2020 2 commits
    • Francisco Massa's avatar
      Fix missing compilation files for video-reader (#2183) · 6f849df0
      Francisco Massa authored
      * Fix missing compilation files for video-reader
      
      * Disable IO tests in travis
      6f849df0
    • 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
  8. 28 Apr, 2020 1 commit
  9. 27 Apr, 2020 1 commit
  10. 21 Apr, 2020 1 commit
    • Negin Raoof's avatar
      [ONNX] Fix for dynamic scale_factor export (#2087) · d6ee8757
      Negin Raoof authored
      * Fixing nms on boxes when no detection
      
      * test
      
      * Fix for scale_factor computation
      
      * remove newline
      
      * Fix for mask_rcnn dynanmic axes
      
      * Clean up
      
      * Update transform.py
      
      * Fix for torchscript
      
      * Fix scripting errors
      
      * Fix annotation
      
      * Fix lint
      
      * Fix annotation
      
      * Fix for interpolate scripting
      
      * Fix for scripting
      
      * refactoring
      
      * refactor the code
      
      * Fix annotation
      
      * Fixed annotations
      
      * Added test for resize
      
      * lint
      
      * format
      
      * bump ORT
      
      * ort-nightly version
      
      * Going to ort 1.1.0
      
      * remove version
      
      * install typing-extension
      d6ee8757
  11. 14 Apr, 2020 1 commit
  12. 10 Apr, 2020 1 commit
  13. 09 Apr, 2020 1 commit
  14. 07 Apr, 2020 1 commit
  15. 03 Apr, 2020 2 commits
    • 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
    • Francisco Massa's avatar
      Add CircleCI job for python lint (#2056) · 0777b51e
      Francisco Massa authored
      * Add CircleCI job for python lint
      
      * Break lint
      
      * Fix
      
      * Fix lint
      
      * Re-enable all tests and remove travis python lint
      0777b51e
  16. 02 Apr, 2020 1 commit
  17. 01 Apr, 2020 1 commit
  18. 31 Mar, 2020 3 commits
    • Negin Raoof's avatar
      ONNX export for variable input sizes (#1840) · 986d2423
      Negin Raoof authored
      
      
      * fixes and tests for variable input size
      
      * transform test fix
      
      * Fix comment
      
      * Dynamic shape for keypoint_rcnn
      
      * Update test_onnx.py
      
      * Update rpn.py
      
      * Fix for split on RPN
      
      * Fixes for feedbacks
      
      * flake8
      
      * topk fix
      
      * Fix build
      
      * branch on tracing
      
      * fix for scalar tensor
      
      * Fixes for script type annotations
      
      * Update rpn.py
      
      * clean up
      
      * clean up
      
      * Update rpn.py
      
      * Updated for feedback
      
      * Fix for comments
      
      * revert to use tensor
      
      * Added test for box clip
      
      * Fixes for feedback
      
      * Fix for feedback
      
      * ORT version revert
      
      * Update ort
      
      * Update .travis.yml
      
      * Update test_onnx.py
      
      * Update test_onnx.py
      
      * Tensor sizes
      
      * Fix for dynamic split
      
      * Try disable tests
      
      * pytest verbose
      
      * revert one test
      
      * enable tests
      
      * Update .travis.yml
      
      * Update .travis.yml
      
      * Update .travis.yml
      
      * Update test_onnx.py
      
      * Update .travis.yml
      
      * Passing device
      
      * Fixes for test
      
      * Fix for boxes datatype
      
      * clean up
      Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
      986d2423
    • Philip Meier's avatar
      Remove python2 compability code (#2033) · 24f16a33
      Philip Meier authored
      * remove sys.version_info == 2
      
      * remove sys.version_info < 3
      
      * remove from __future__ imports
      24f16a33
    • Philip Meier's avatar
      Remove six dependency (#2017) · 42b8d462
      Philip Meier authored
      * remove six from python code
      
      * remove six from setup.py
      
      * remove six from tests
      
      * remove six from references
      
      * remove six from packaging
      
      * revert str to torch._six._string_classes
      
      * revert str to torch._six._string_classes
      42b8d462
  19. 23 Mar, 2020 2 commits
  20. 20 Mar, 2020 1 commit
  21. 17 Mar, 2020 2 commits
    • Francisco Massa's avatar
      Update video reader to use new decoder (#1978) · 32e16805
      Francisco Massa authored
      * Base decoder for video. (#1747)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1747
      
      Pull Request resolved: https://github.com/pytorch/vision/pull/1746
      
      Added the implementation of ffmpeg based decoder with functionality that can be used in VUE and TorchVision.
      
      Reviewed By: fmassa
      
      Differential Revision: D19358914
      
      fbshipit-source-id: abb672f89bfaca6351dda2354f0d35cf8e47fa0f
      
      * Integrated base decoder into VideoReader class and video_utils.py (#1766)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1766
      
      Replaced FfmpegDecoder (incompativle with VUE) by base decoder (compatible with VUE).
      Modified python utilities video_utils.py for internal simplification. Public interface got preserved.
      
      Reviewed By: fmassa
      
      Differential Revision: D19415903
      
      fbshipit-source-id: 4d7a0158bd77bac0a18732fe4183fdd9a57f6402
      
      * Optimizating base decoder performance. (#1852)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1852
      
      Changed base decoder internals for a faster clip processing.
      
      Reviewed By: stephenyan1231
      
      Differential Revision: D19748379
      
      fbshipit-source-id: 58a435f0a0b25545e7bd1a3edb0b1d558176a806
      
      * Minor fix and decoder class members access.
      
      Summary:
      Found and fix a bug in cropping algorithm (simple mistyping).
      Also derived classes need access to some decoder class members, like initialization parameters - make it protected.
      
      Reviewed By: stephenyan1231, fmassa
      
      Differential Revision: D19895076
      
      fbshipit-source-id: 691336c8e18526b085ae5792ac3546bc387a6db9
      
      * Added missing header for less dependencies. (#1898)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1898
      
      Include streams/samplers shouldn't depend on decoder headers. Add dependencies directly to the place where they are required.
      
      Reviewed By: stephenyan1231
      
      Differential Revision: D19911404
      
      fbshipit-source-id: ef322a053708405c02cee4562b456b1602fb12fc
      
      * Implemented VUE Asynchronous Decoder
      
      Summary: For Mothership we have found that asynchronous decoder provides a better performance.
      
      Differential Revision: D20026194
      
      fbshipit-source-id: 627b91844b4e3f917002031dd32cb19c239f4ba8
      
      * fix a bug in API read_video_from_memory (#1942)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1942
      
      In D18720474, it introduces a bug in `read_video_from_memory` API. Thank weiyaowang for reporting it.
      
      Reviewed By: weiyaowang
      
      Differential Revision: D20270179
      
      fbshipit-source-id: 66348c99a5ad1f9129b90e934524ddfaad59de03
      
      * extend decoder to support new video_max_dimension argument (#1924)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1924
      
      Extend `video reader` decoder python API in Torchvision to support a new argument `video_max_dimension`. This enables the new video decoding use cases. When setting `video_width=0`, `video_height=0`, `video_min_dimension != 0`, and `video_max_dimension != 0`, we can rescale the video clips so that its spatial resolution (height, width) becomes
       - (video_min_dimension, video_max_dimension) if original height < original width
       - (video_max_dimension, video_min_dimension) if original height >= original width
      
      This is useful at video model testing stage, where we perform fully convolution evaluation and take entire video frames without cropping as input. Previously, for instance we can only set `video_width=0`, `video_height=0`, `video_min_dimension = 128`, which will preserve aspect ratio. In production dataset, there are a small number of videos where aspect ratio is either extremely large or small, and when the shorter edge is rescaled to 128, the longer edge is still large. This will easily cause GPU memory OOM when we sample multiple video clips, and put them in a single minibatch.
      
      Now, we can set (for instance) `video_width=0`, `video_height=0`, `video_min_dimension = 128` and `video_max_dimension = 171` so that the rescale resolution is either (128, 171) or (171, 128) depending on whether original height is larger than original width. Thus, we are less likely to have gpu OOM because the spatial size of video clips is determined.
      
      Reviewed By: putivsky
      
      Differential Revision: D20182529
      
      fbshipit-source-id: f9c40afb7590e7c45e6908946597141efa35f57c
      
      * Fixing samplers initialization (#1967)
      
      Summary:
      Pull Request resolved: https://github.com/pytorch/vision/pull/1967
      
      
      
      No-ops for torchvision diff, which fixes samplers.
      
      Differential Revision: D20397218
      
      fbshipit-source-id: 6dc4d04364f305fbda7ca4f67a25ceecd73d0f20
      
      * Exclude C++ test files
      Co-authored-by: default avatarYuri Putivsky <yuri@fb.com>
      Co-authored-by: default avatarZhicheng Yan <zyan3@fb.com>
      32e16805
    • Negin Raoof's avatar
      [ONNX] Disable model tests since export of interpolate script module is broken (#1989) · 8b9859d3
      Negin Raoof authored
      * Fix for roi_align export
      
      * Disable interpolate script module tests
      
      Disable test until export of interpolate script module to ONNX is fixed
      8b9859d3
  22. 13 Mar, 2020 1 commit
  23. 10 Mar, 2020 1 commit
  24. 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
  25. 14 Feb, 2020 1 commit
  26. 04 Feb, 2020 1 commit
    • F-G Fernandez's avatar
      Added __repr__ attribute to GeneralizedRCNNTransform (#1834) · e2573a71
      F-G Fernandez authored
      * feat: Added __repr__ attribute to GeneralizedRCNNTransform
      
      Added more details to default __repr__ attribute for printing.
      
      * fix: Put back relative imports
      
      * style: Fixed pep8 compliance
      
      Switched strings with  syntax to f-strings.
      
      * test: Added test for GeneralizedRCNNTransform __repr__
      
      Checked integrity of __repr__ attribute
      
      * test: Fixed unittest for __repr__
      
      Fixed the formatted strings in the __repr__ integrity check for GeneralizedRCNNTransform
      
      * fix: Fixed f-strings for earlier python versions
      
      Switched back f-strings to .format syntax for Python3.5 compatibility.
      
      * fix: Fixed multi-line string
      
      Fixed multiple-line string syntax for compatibility
      
      * fix: Fixed GeneralizedRCNNTransform unittest
      
      Fixed formatting of min_size argument of the resizing part
      e2573a71
  27. 29 Jan, 2020 3 commits
  28. 28 Jan, 2020 1 commit
  29. 27 Jan, 2020 1 commit
  30. 22 Jan, 2020 1 commit
    • Philip Meier's avatar
      Fix fill in rotate (#1760) · 8f4f8d89
      Philip Meier authored
      * initial fix
      
      * outsourced num bands lookup
      
      * fix doc
      
      * added pillow version requirement
      
      * simplify number of bands extraction
      
      * remove unrelated change
      
      * remove indirect dependency on pillow>=5.2.0
      
      * extend docstring to transform
      
      * bug fix
      
      * added test
      8f4f8d89