This is the code
from imageai.Detection import VideoObjectDetection
import os
execution_path = os.getcwd()
detector = VideoObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(execution_path, "resnet50_coco_best_v2.0.1.h5"))
custom_objects = detector.CustomObjects(car=True, motorcycle=True, truck=True)
video_path = detector.detectCustomObjectsFromVideo(
custom_objects=custom_objects,
input_file_path=os.path.join(execution_path, "cars.avi"),
save_detected_video=False,
frames_per_second=30,
log_progress=True)
print(video_path)
and this is the error
An error occured. It may be that your input video is invalid. Ensure you specified a proper string value for 'output_file_path' is 'save_detected_video' is not False. "
ValueError: An error occured. It may be that your input video is invalid. Ensure you specified a proper string value for 'output_file_path' is 'save_detected_video' is not False. Also ensure your per_frame, per_second, per_minute or video_complete_analysis function is properly configured to receive the right parameters.
@shivam9804 Do you have the latest version installed v.2.1.5?
pip3 install imageai --upgrade@OlafenwaMoses Thank you for the response, it solved my problem.
Am happy to know that.