我想使用脚本来检测视频中的对象
from imageai.Detection import VideoObjectDetection
import os
execution_path = os.getcwd()
detector = VideoObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "model.h5"))
detector.loadModel()
video_path = detector.detectObjectsFromVideo(
input_file_path=os.path.join(execution_path, "cars.mp4"),
output_file_path=os.path.join(execution_path, "traffic_detected1"),
frames_per_second=20,
log_progress=True
)
print(video_path)
但是我看到一个错误:
ValueError: You are trying to load a weight file containing 82 layers into a model with 116 layers.