Browse Source

新增模型推理模块功能测试

liyan 4 months ago
parent
commit
b750175100
1 changed files with 12 additions and 0 deletions
  1. 12 0
      tests/inference_test.py

+ 12 - 0
tests/inference_test.py

@@ -0,0 +1,12 @@
+from watermark_verify.inference.rcnn_inference import FasterRCNNInference
+from watermark_verify.inference.ssd_inference import SSDInference
+from watermark_verify.inference.yolox_inference import YOLOXInference
+
+if __name__ == '__main__':
+    # model_filename = "/mnt/e/DevTools/workspace/model_watermark_detect/tests/models/origin/yolox/yolox.onnx"
+    # dets = YOLOXInference(model_filename).predict('coco/val2017/000000005992.jpg')
+    # model_filename = "/mnt/e/DevTools/workspace/model_watermark_detect/tests/models/whitebox/ssd/ssd.onnx"
+    # dets = SSDInference(model_filename).predict('coco/val2017/000000000872.jpg')
+    model_filename = "/mnt/e/DevTools/workspace/model_watermark_detect/tests/models/origin/faster-rcnn/faster-rcnn.onnx"
+    dets = FasterRCNNInference(model_filename).predict('coco/val2017/000000000872.jpg')
+    print(f"dets: {dets}")