Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

make_assets.py 634 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. import torch
  2. from torch.utils.mobile_optimizer import optimize_for_mobile
  3. from torchvision.models.detection import (
  4. fasterrcnn_mobilenet_v3_large_320_fpn,
  5. FasterRCNN_MobileNet_V3_Large_320_FPN_Weights,
  6. )
  7. print(torch.__version__)
  8. model = fasterrcnn_mobilenet_v3_large_320_fpn(
  9. weights=FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT,
  10. box_score_thresh=0.7,
  11. rpn_post_nms_top_n_test=100,
  12. rpn_score_thresh=0.4,
  13. rpn_pre_nms_top_n_test=150,
  14. )
  15. model.eval()
  16. script_model = torch.jit.script(model)
  17. opt_script_model = optimize_for_mobile(script_model)
  18. opt_script_model.save("VisionTestApp/frcnn_mnetv3.pt")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...