opencv dnn完整示例

目录

python 导出onnx:

python预测例子:

c++ dnn调用例子:


python 导出onnx:

   weights = 'xxxx.pth'

    model_cls= Model_net(model_path=weights, num_classes=2)
    state_dict = torch.load(weights)
    model_cls.load_state_dict(state_dict)
    model_cls.eval()

    dummy_input1 = torch.randn(1, 3, 64, 64)

    onnx_name &

你可能感兴趣的:(深度学习宝典,opencv,dnn,pytorch)