1. 21 Jul, 2022 1 commit
  2. 14 Jul, 2022 2 commits
  3. 11 Jul, 2022 1 commit
    • vfdev's avatar
      [proto] Added some transformations and fixed type hints (#6245) · 9effc4cd
      vfdev authored
      * Another attempt to add transforms
      
      * Fixed padding type hint
      
      * Fixed fill arg for pad and rotate, affine
      
      * code formatting and type hints for affine transformation
      
      * Fixed flake8
      
      * Updated tests to save and load transforms
      
      * Fixed code formatting issue
      
      * Fixed jit loading issue
      
      * Restored fill default value to None
      Updated code according to the review
      
      * Added tests for rotation, affine and zoom transforms
      
      * Put back commented code
      
      * Random erase bypass boxes and masks
      Go back with if-return/elif-return/else-return
      
      * Fixed acceptable and non-acceptable types for Cutmix/Mixup
      
      * Updated conditions for _BaseMixupCutmix
      9effc4cd
  4. 08 Jul, 2022 2 commits
  5. 07 Jul, 2022 1 commit
    • YosuaMichael's avatar
      Adding video accuracy for video_classification reference script (#6241) · 8a45147f
      YosuaMichael authored
      * Add ensembled video accuracy on video reference script
      
      * Change the parser func to be similar with classification reference
      
      * Fix typo type->dtype
      
      * Use custom kinetics
      
      * Fix dataset to not getting start_pts
      
      * Change dataset name, and put video_idx at the back
      
      * Ufmt format
      
      * Use functional softmax, updating meta and use it to overwrite eval param
      
      * Fix typo
      
      * Put the eval parameters on the docs for now
      
      * Change meta for video resnet to use frame-rate 15, also change wording on docs
      8a45147f
  6. 06 Jul, 2022 1 commit
    • vfdev's avatar
      [proto] Added mid-level ops and feature-based ops (#6219) · bd19fb8e
      vfdev authored
      * Added mid-level ops and feature-based ops
      
      * Fixing deadlock in dataloader with circular imports
      
      * Added non-scalar fill support workaround for pad
      
      * Removed comments
      
      * int/float support for fill in pad op
      
      * Updated type hints and removed bypass option from mid-level methods
      
      * Minor nit fixes
      bd19fb8e
  7. 05 Jul, 2022 2 commits
  8. 01 Jul, 2022 1 commit
  9. 27 Jun, 2022 1 commit
  10. 24 Jun, 2022 1 commit
    • Vasilis Vryniotis's avatar
      Add MViT architecture in TorchVision (#6198) · fb7f9a16
      Vasilis Vryniotis authored
      * Adding MViT v2 architecture (#6105)
      
      * Adding mvitv2 architecture
      
      * Fixing memory issues on tests and minor refactorings.
      
      * Adding input validation
      
      * Adding docs and minor refactoring
      
      * Add `min_temporal_size` in the supported meta-data.
      
      * Switch Tuple[int, int, int] with List[int] to support easier the 2D case
      
      * Adding more docs and references
      
      * Change naming conventions of classes to follow the same pattern as MobileNetV3
      
      * Fix test breakage.
      
      * Update todos
      
      * Performance optimizations.
      
      * Add support to MViT v1 (#6179)
      
      * Switch implementation to v1 variant.
      
      * Fix docs
      
      * Adding back a v2 pseudovariant
      
      * Changing the way the network are configured.
      
      * Temporarily removing v2
      
      * Adding weights.
      
      * Expand _squeeze/_unsqueeze to support arbitrary dims.
      
      * Update references script.
      
      * Fix tests.
      
      * Fixing frames and preprocessing.
      
      * Fix std/mean values in transforms.
      
      * Add permanent Dropout and update the weights.
      
      * Update accuracies.
      
      * Fix documentation
      
      * Remove unnecessary expected file.
      
      * Skip big model test
      
      * Rewrite the configuration logic to reduce LOC.
      
      * Fix mypy
      fb7f9a16
  11. 23 Jun, 2022 4 commits
    • vfdev's avatar
      [proto] Improvements for functional API and tests (#6187) · 6155808f
      vfdev authored
      * Added base tests for rotate_image_tensor
      
      * Updated resize_image_tensor API and tests and fixed a bug with max_size
      
      * Refactored and modified private api for resize functional op
      
      * Fixed failures
      
      * More updates
      
      * Updated proto functional op: resize_image_*
      
      * Added max_size arg to resize_bounding_box and updated basic tests
      
      * Update functional.py
      
      * Reverted fill/center order for rotate
      Other nits
      6155808f
    • vfdev's avatar
      Refactored and modified private api for resize functional op (#6191) · aeafa912
      vfdev authored
      * Refactored and modified private api for resize functional op
      
      * Fixed failures
      
      * More updates
      
      * Fixed flake8
      aeafa912
    • vfdev's avatar
      a5536de9
    • YosuaMichael's avatar
      Add raft-stereo model to prototype/models (#6107) · 11caf37a
      YosuaMichael authored
      * Add rough raft-stereo implementation on prototype/models
      
      * Add standard raft_stereo builder, and modify context_encoder to be more similar with original implementation
      
      * Follow original implementation on pre-convolve context
      
      * Fix to make sure we can load original implementation weight and got same output
      
      * reusing component from raft
      
      * Make the raft_stereo_fast able to load original weight implementation
      
      * Format with ufmt and update some comment
      
      * Use raft FlowHead
      
      * clean up comments
      
      * Remove unnecessary import and use ufmt format
      
      * Add __all__ and more docs for RaftStereo class
      
      * Only accept param and not module for raft stereo builder
      
      * Cleanup comment
      
      * Adding typing to raft_stereo
      
      * Update some of raft code and reuse on raft stereo
      
      * Use bool instead of int
      
      * Make standard raft_stereo model jit scriptable
      
      * Make the function _make_out_layer using boolean with_block and init the block_layer with identity
      
      * Separate corr_block into two modules for pyramid and building corr features
      
      * Use tuple if input is not variable size, also remove default value if using List
      
      * Format using ufmt and update ConvGRU to not inherit from raft in order to satisfy both jit script and mypy
      
      * Change RaftStereo docs input type
      
      * Ufmt format raft
      
      * revert back convgru to see mypy errors, add test for jit and fx, make the model fx compatible
      
      * ufmt format
      
      * Specify device for new tensor, dont init module then overwrite and put if-else instead
      
      * Ignore mypy problem on override, put back num_iters on forward
      
      * Revert some effort to make it fx compatible but unnecessary now
      
      * refactor code and remove num_iters from RaftStereo constructor
      
      * Change to raft_stereo_realtime, and specify device directly for tensor creation
      
      * Add description for raft_stereo_realtime
      
      * Update the test for raft_stereo
      
      * Fix raft stereo prototype test to properly test jit script
      
      * Ufmt format
      
      * Test against expected file, change name from raft_stereo to raft_stereo_builder to prevent import error
      
      * Revert __init__.py changes
      
      * Add default value for non-list param on model builder
      
      * Add checking on out_with_block length, add more docs on the encoder
      
      * Use base instead of basic since it is more commonly used
      
      * rename expect file to base as well
      
      * rename on test
      
      * Revert the revert of __init__.py, also revert the adding default value to _raft_stereo to follow the standard pattern
      
      * ufmt format __init__.py
      11caf37a
  12. 22 Jun, 2022 1 commit
  13. 16 Jun, 2022 2 commits
  14. 14 Jun, 2022 1 commit
  15. 13 Jun, 2022 1 commit
    • Lenz's avatar
      Added elastic transform in torchvision.transforms (#4938) · 9430be76
      Lenz authored
      
      
      * Added elastic augment
      
      * ufmt formatting
      
      * updated comments
      
      * fixed circular dependency issue and bare except error
      
      * Fixed three type checking errors in functional_tensor.py
      
      * ufmt formatted
      
      * changed elastic_deformation to a more common implementation
      
      Implementation uses alpha and sigma to control strength and smoothness of the displacement vectors in elastic_deformation instead of control_point_spacings and sigma.
      
      * ufmt formatting
      
      * Some performance updates
      
      Put random offset vectors to device before gaussian_blur is applied speeds it up 3-fold.
      
      * fixed type error
      
      * fixed again a type error
      
      * Update torchvision/transforms/functional_tensor.py
      Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
      
      * Added some requested changes
      
      - pil image support similar to GaussianBlur
      - changed interpolation arg to InterpolationMode
      - added a wrapper in torchvision.transforms.functional.py that gets called by the class in transforms.py
      -renamed it to ElasticTransform
      - handled sigma = 0 case
      
      * added img docstring
      
      * added some tests
      
      * Updated tests and the code
      
      * Added the requested changes to the arguments of F.elastic_transform
      
      Added random_state and displacement as arguments to F.elastic_transform
      
      * fixed the type error
      
      * Fixed tests and docs
      
      * implemented requested changes
      
      Changes:
      1) alpha AND sigma OR displacement must be given as arguments to transforms.functional_tensor.elastic_transform instead of alpha AND sigma AND displacement
      2) displacements are accepted in transforms.functional.elastic_transform as np.array and torch.Tensor instead of only accepting torch.Tensor
      
      * ufmt formatting
      
      * trochscript error resolved
      
      replaced torch.from_numpy() to torch.Tensor() to make it compatible to torchscript
      
      * revert to torch.from_numpy()
      
      * updated argument checks and errors
      
      - In F.elastic_transform added check to see if both user inputs img and displacement are either of type PIL Image and ndarray or both of type tensor.
      - In F_t.elastic_transform added check if alpha and sigma are None if displacement is given or vice versa.
      
      * fixed seed error
      
      changed torch.seed to torch.manual_seed in F_t.elastic_transform
      
      * Reverted displacement type and other cosmetics
      
      * Other minor improvements
      
      * changed gaussian_blur filter size
      
      changed gaussian_blur filter size
      from
      4 * int(sigma) + 1
      to
      int(8 * sigma + 1)
      to make it consistent with ernestums implementation
      
      * resolved merge error
      
      * Revert "resolved merge error"
      
      This reverts commit 6a4a4e74ff4d078e2c2753d359185f9a81c415d0.
      
      * resolve merge error
      
      * ufmt formatted
      
      * ufmt formated once again..
      
      * fixed unsupported operand error
      
      * Update API and removed random_state from functional part
      
      * Added default values
      
      * Added ElasticTransform to gallery and updated the docstring
      
      * Updated gallery and added _log_api_usage_once
      BTW, matplotlib.pylab is deprecated
      
      * Updated gallery transforms code
      
      * Updates according to review
      Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
      9430be76
  16. 11 Jun, 2022 1 commit
  17. 10 Jun, 2022 1 commit
  18. 09 Jun, 2022 2 commits
  19. 08 Jun, 2022 1 commit
    • Nicolas Hug's avatar
      [FBcode->GH] [quant][core][better-engineering] Rename files in quantized directory… (#6133) · a7e4fbdc
      Nicolas Hug authored
      * [quant][core][better-engineering] Rename files in quantized directory to conform with non-quantized countertpart filenames (#77037)
      
      Summary:
      X-link: https://github.com/pytorch/pytorch/pull/77037
      
      
      
      Names of analogous files in quantized directory (previously snake case) were inconsistent with
      their non-quantized filename counterparts (pascal case). This is the first of a series of PRs that changes
      all files in quantized (and sub-directories) dir to have pascal case.
      
      `aten/src/ATen/native/quantized/qconv_unpack.cpp` has not been renamed yet
      because (for reasons currently unknown) after making the name change, `import torch` produces the below error (`qlinear_unpack.cpp` renaming also seems to fail some phabricator CI tests for similar reasons). We suspect that these may be undefined errors and will revisit naming these files in a future PR.
      
      ```
      terminate called after throwing an instance of 'c10::Error'
        what():  Type c10::intrusive_ptr<ConvPackedParamsBase<2> > could not be converted to any of the known types.
      Exception raised from operator() at ../aten/src/ATen/core/jit_type.h:1735 (most recent call first):
      frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x55 (0x7f26745c0c65 in /data/users/dzdang/pytorch/torch/lib/libc10.so)
      frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xb1 (0x7f26745bdcd1 in /data/users/dzdang/pytorch/torch/lib/libc10.so)
      frame #2: <unknown function> + 0x1494e24 (0x7f2663b14e24 in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #3: <unknown function> + 0xfed0bc (0x7f266366d0bc in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #4: c10::detail::infer_schema::make_function_schema(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>, c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>) + 0x5a (0x7f266366d71a in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #5: c10::detail::infer_schema::make_function_schema(c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>, c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>) + 0x7b (0x7f266366e06b in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #6: <unknown function> + 0x1493f32 (0x7f2663b13f32 in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #7: <unknown function> + 0xe227dd (0x7f26634a27dd in /data/users/dzdang/pytorch/torch/lib/libtorch_cpu.so)
      frame #8: <unknown function> + 0x14e0a (0x7f268c934e0a in /lib64/ld-linux-x86-64.so.2)
      ..........................truncated.............
      ```
      
      Reviewed By: malfet
      
      Differential Revision: D36862332
      
      Pulled By: dzdang
      
      fbshipit-source-id: 598c36656b4e71f906d940e7ff19ecf82d43031d
      
      * empty commit
      
      * empty commit
      
      * empty commit
      Co-authored-by: default avatardzdang <dzdang@umich.edu>
      Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
      a7e4fbdc
  20. 06 Jun, 2022 1 commit
  21. 31 May, 2022 1 commit
  22. 30 May, 2022 1 commit
  23. 26 May, 2022 3 commits
    • Vasilis Vryniotis's avatar
      6aaa2b00
    • YosuaMichael's avatar
      Refactor swin transfomer so later we can reuse component for 3d version (#6088) · 952f4806
      YosuaMichael authored
      * Use List[int] instead of int for window_size and shift_size
      
      * Make PatchMerging and SwinTransformerBlock able to handle 2d and 3d cases
      
      * Separate patch embedding from SwinTransformer and enable to get model without head by specifying num_heads=None
      
      * Dont use if before padding so it is fx friendly
      
      * Put the handling on window_size edge cases on separate function and wrap with torch.fx.wrap so it is excluded from tracing
      
      * Update the weight url to the converted weight with new structure
      
      * Update the accuracy of swin_transformer
      
      * Change assert to Exception and nit
      
      * Make num_classes optional
      
      * Add typing output for _fix_window_and_shift_size function
      
      * init head to None to make it jit scriptable
      
      * Revert the change to make num_classes optional
      
      * Revert unneccesarry changes that might be risky
      
      * Remove self.head declaration
      952f4806
    • Philip Meier's avatar
      add tests for F.pad_bounding_box (#6038) · 1d50dfa0
      Philip Meier authored
      
      
      * add tests for F.pad_bounding_box
      
      * Added correctness tests for pad and reimplemented bbox op to keep dtype
      
      * Update _geometry.py
      Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
      1d50dfa0
  24. 25 May, 2022 1 commit
  25. 23 May, 2022 5 commits
  26. 20 May, 2022 1 commit