1. 07 Apr, 2022 1 commit
    • Owen Wang's avatar
      add metal GPU to d2go export · 6b4dbb31
      Owen Wang authored
      Summary: Allow string name of export type to indicate which mobile opt backend user wants to trigger.
      
      Reviewed By: wat3rBro
      
      Differential Revision: D35375928
      
      fbshipit-source-id: dc3f91564681344e1d43862423ab5dc63b6644d3
      6b4dbb31
  2. 05 Apr, 2022 2 commits
    • Yanghan Wang's avatar
      support do_postprocess when tracing rcnn model in D2 style · 647a3fdf
      Yanghan Wang authored
      Summary:
      Pull Request resolved: https://github.com/facebookresearch/d2go/pull/200
      
      Currently when exporting the RCNN model, we call it with `self.model.inference(inputs, do_postprocess=False)[0]`, therefore the output of exported model is not post-processed, eg. the mask is in the squared shape. This diff adds the option to include postprocess in the exported model.
      
      Worth noting that since the input is a single tensor, the post-process doesn't resize the output to original resolution, and we can't apply the post-process twice to further resize it in the Predictor's PostProcessFunc, add an assertion to raise error in this case. But this is fine for most production use cases where the input is not resized.
      
      Set `RCNN_EXPORT.INCLUDE_POSTPROCESS` to `True` to enable this.
      
      Reviewed By: tglik
      
      Differential Revision: D34904058
      
      fbshipit-source-id: 65f120eadc9747e9918d26ce0bd7dd265931cfb5
      647a3fdf
    • Yanghan Wang's avatar
      refactor create_fake_detection_data_loader · 312c6b62
      Yanghan Wang authored
      Summary:
      Pull Request resolved: https://github.com/facebookresearch/d2go/pull/199
      
      - `create_fake_detection_data_loader` currently doesn't take `cfg` as input, sometimes we need to test the augmentation that needs more complicated different cfg.
      - name is a bit bad, rename it to `create_detection_data_loader_on_toy_dataset`.
      - width/height were the resized size previously, we want to change it to the size of data source (image files) and use `cfg` to control resized size.
      
      Update V3:
      In V2 there're some test failures, the reason is that V2 is building data loader (via GeneralizedRCNN runner) using actual test config instead of default config before this diff + dataset name change. In V3 we uses the test's runner instead of default runner for the consistency. This reveals some real bugs that we didn't test before.
      
      Reviewed By: omkar-fb
      
      Differential Revision: D35238890
      
      fbshipit-source-id: 28a6037374e74f452f91b494bd455b38d3a48433
      312c6b62
  3. 31 Mar, 2022 1 commit
  4. 30 Mar, 2022 1 commit
  5. 28 Mar, 2022 1 commit
  6. 25 Mar, 2022 1 commit
  7. 24 Mar, 2022 4 commits
  8. 22 Mar, 2022 1 commit
    • Owen Wang's avatar
      add .npy file handling in evaluator and visualizer · a0ee06f3
      Owen Wang authored
      Summary: Detectron2[Go]'s Visualizer and sem_seg_evaluation now updated with customization entrypoints for how to handle reading semantic seg masks. By default, PIL and PNG images are expected. However, some specific projects' datasets use .npy files and this customization allows providing an alternate Visualizer and evaluation function for reading them.
      
      Reviewed By: newstzpz
      
      Differential Revision: D33434948
      
      fbshipit-source-id: 42af16d6708ffc5b2c03ec8507757313e23c8204
      a0ee06f3
  9. 21 Mar, 2022 1 commit
    • Hang Zhang's avatar
      rm TARGET in gitignore · 2fe42c47
      Hang Zhang authored
      Summary: rm TARGET in gitignore
      
      Reviewed By: newstzpz
      
      Differential Revision: D35014854
      
      fbshipit-source-id: 4a28f797bd5277eb58df6921f3ae9b7debb65f71
      2fe42c47
  10. 18 Mar, 2022 1 commit
    • Owen Wang's avatar
      d2go/semantic_seg Pre- and PostprocessFunc · 731d98f9
      Owen Wang authored
      Summary: Add documentation on the pre and post processing functions for segmentation.
      
      Reviewed By: XiaoliangDai
      
      Differential Revision: D34882165
      
      fbshipit-source-id: 375c62d0ad632a40b6557065b3362e333df8c55f
      731d98f9
  11. 17 Mar, 2022 1 commit
    • Yanghan Wang's avatar
      misc updates · 4f651f97
      Yanghan Wang authored
      Summary:
      - remove the `None` support for `merge_from_list`
      - fix logging when initializing diskcacje
      - Don't inherit `_FakeListObj` fron `list`, so looping over it can raise error.
      
      Reviewed By: sstsai-adl
      
      Differential Revision: D34952714
      
      fbshipit-source-id: f636e408b79ed77904f257f189fcef216cb2efbc
      4f651f97
  12. 16 Mar, 2022 4 commits
    • Tsahi Glik's avatar
      Cleanup QAT api · 5074692f
      Tsahi Glik authored
      Summary:
      Pull Request resolved: https://github.com/facebookresearch/d2go/pull/190
      
      Currently there is some fragmentation in export for how to apply convert logic in various mode. `prepare_for_quant_convert` is only called in non eager modes and the logic in eager mode is not customizable.
      This diff unify the `prepare_for_quant_convert` code path for all quantization modes.
      Also in this diff we rename `_non_qat_to_qat_state_dict_map`, that is use in qat checkpointer to be publish var `non_qat_to_qat_state_dict_map` and allow models to populate it with custom mapping. This is useful in cases where the param mapping between the non qat model and the qat model cannot be inferred definitely (see note in https://fburl.com/code/9rx172ht) and have some ambiguity that can only be resolved by the model logic.
      
      Reviewed By: wat3rBro
      
      Differential Revision: D34741217
      
      fbshipit-source-id: 38edfec64200ec986ffe4f3d47f527cb6a3fb5e9
      5074692f
    • Yanghan Wang's avatar
      fix the overwrite_opts and handle the new_allowed properly · 2b618211
      Yanghan Wang authored
      Summary:
      D33301363 changes the signature of `update_cfg` from `update_cfg(cfg, *updaters)` to `update_cfg(cfg, updaters, new_allowed)`, while the call sites are not updated. Eg. https://www.internalfb.com/code/fbsource/[9e071979a62ba7fd3d7a71dee1f0809815cbaa43]/fbcode/fblearner/flow/projects/mobile_vision/detectron2go/core/workflow.py?lines=221-225, the `merge_from_list_updater(e2e_train.overwrite_opts),` is then not used.
      
      For the fix:
      - Since there're a lot of call sites for `update_cfg` it's better to keep the original signature.
      - ~~~The `new_allowed` can actually be passed to each individual updater instead of the `update_cfg`, this also gives finer control.~~~
      - Make override the `merge_from_list` to make it respect `new_allowed`.
      - Preserve the `new_allowed` for all nodes (not only the root) in the FLOW Future calls.
      
      Reviewed By: zhanghang1989
      
      Differential Revision: D34840001
      
      fbshipit-source-id: 14aff6bec75a8b53d4109e6cd73d2494f68863b4
      2b618211
    • Chengjiang Long's avatar
      Implement the user calibration model option 3 under D2GO · b30cf9d2
      Chengjiang Long authored
      Summary:
      Dataloader:
      Rewrote the data loader via build_stream_dataset_reader with the DATASET_DEFINITION of "peopleai_face_eng_inference_results".
      
      User Calibration Model (initial version):
      
      nn.Sequential(
          nn.Conv1d(72, 128, 1),
          nn.BatchNorm1d(128),
          nn.ReLU(),
          nn.Flatten(),
          nn.Linear(128, 72),
      )
      
      Differential Revision: D34202009
      
      fbshipit-source-id: 55a2c579e463ed19eac38b5dd12e11c09cbccc11
      b30cf9d2
    • Ananth Subramaniam's avatar
      Trainer(checkpoint_callback) -> Trainer(enable_checkpointing) · f781223c
      Ananth Subramaniam authored
      Reviewed By: kazhang
      
      Differential Revision: D34669519
      
      fbshipit-source-id: 8cfee968104c823a55960f2730d8e888ac1f298e
      f781223c
  13. 10 Mar, 2022 1 commit
  14. 09 Mar, 2022 1 commit
  15. 08 Mar, 2022 2 commits
  16. 07 Mar, 2022 1 commit
  17. 05 Mar, 2022 2 commits
  18. 04 Mar, 2022 4 commits
  19. 03 Mar, 2022 1 commit
  20. 01 Mar, 2022 1 commit
    • Tong Xiao's avatar
      Allow Users to Disable the Evaluation after the Last Training Iteration · f16cc060
      Tong Xiao authored
      Summary:
      `Detectron2GoRunner` defaults to trigger an evaluation right after the last iteration in the `runner.do_train` method. This sometimes might be unnecessary, because there is a `runner.do_test` at the end of training anyways.
      
      It could also lead to some side effects. For example, it would cause the training and test data loader present at the same time, which led to an OOM issue in our use case.
      
      In this diff, we add an option `eval_after_train` in the `EvalHook` to allow users to disable the evaluation after the last training iteration.
      
      Reviewed By: wat3rBro
      
      Differential Revision: D34295685
      
      fbshipit-source-id: 3612eb649bb50145346c56c072ae9ca91cb199f5
      f16cc060
  21. 28 Feb, 2022 2 commits
  22. 25 Feb, 2022 1 commit
  23. 24 Feb, 2022 1 commit
    • Yanghan Wang's avatar
      exclude d2go&project lib from .gitignore · fb0164c3
      Yanghan Wang authored
      Summary: It's possible to have `lib` under core `mobile-vision/d2go/{d2go,projects}`, exclude them from `.gitignore`.
      
      Reviewed By: zhanghang1989
      
      Differential Revision: D34288538
      
      fbshipit-source-id: 7094cdf4f52263fbf6ff6707d487bc3328fbbd8b
      fb0164c3
  24. 23 Feb, 2022 3 commits
  25. 14 Feb, 2022 1 commit
    • Tugrul Savran's avatar
      D2Go Fail Fast: Move exception coming from not implemented "compare accuracy" feature to the top. · eee4dfc1
      Tugrul Savran authored
      Summary:
      Currently, the exporter method takes in a compare_accuracy parameter, which after all the compute (exporting etc.) raises an exception if it is set to True.
      
      This looks like an antipattern, and causes a waste of compute.
      
      Therefore, I am proposing to raise the exception at the very beginning of method call to let the client know in advance that this argument's functionality isn't implemented yet.
      
      NOTE: We might also choose to get rid of the entire parameter. I am open for suggestions.
      
      Differential Revision: D34186578
      
      fbshipit-source-id: d7fbe7589dfe2d2f688b870885ca61e6829c9329
      eee4dfc1