summaryrefslogtreecommitdiffstats
path: root/r_facelib/detection/yolov5face/utils/extract_ckpt.py
diff options
context:
space:
mode:
Diffstat (limited to 'r_facelib/detection/yolov5face/utils/extract_ckpt.py')
-rw-r--r--r_facelib/detection/yolov5face/utils/extract_ckpt.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/r_facelib/detection/yolov5face/utils/extract_ckpt.py b/r_facelib/detection/yolov5face/utils/extract_ckpt.py
new file mode 100644
index 0000000..e6bde00
--- /dev/null
+++ b/r_facelib/detection/yolov5face/utils/extract_ckpt.py
@@ -0,0 +1,5 @@
+import torch
+import sys
+sys.path.insert(0,'./facelib/detection/yolov5face')
+model = torch.load('facelib/detection/yolov5face/yolov5n-face.pt', map_location='cpu')['model']
+torch.save(model.state_dict(),'../../models/facedetection') \ No newline at end of file