deploy目录下infer.py代码的detector.predict()函数遇到问题
Created by: xmy0916
代码一:
mat = cv2.imread("test2.jpg")
results = detector.predict(mat, FLAGS.threshold)
代码二:
results = detector.predict("test2.jpg", FLAGS.threshold)
两个代码都可以运行但是输出结果不一样:
我觉得可能是我直接传Mat类型作为参数的问题,但是我看了官方给的def predict_video():函数里面也是直接传Mat类型的呀,是不是存在问题呢
predict_video里面部分代码:
capture = cv2.VideoCapture(FLAGS.video_file)
ret, frame = capture.read()
results = detector.predict(frame, FLAGS.threshold)