Assistance using the predict_video function for object detection and tracking

635
2
04-05-2021 12:54 PM
NatalieDobbs1
New Contributor II

Hello,

I am kindly asking for assistance in resolving an error I am receiving when running a predict_video function on a video for object detection and tracking. I created the model using the RetinaNet model, and it is being stored on ArcGIS Online. I wanted to run the predict_video function on a video to obtain outputs on object detection and tracking. 

The inference and tracking section of the script located in the link below used the RetinaNet function, which the script used earlier in the load model architecture section. Ideally, I would want to run the script using the predict_video function using the created model when needed without going through the steps to create the model each time.

https://developers.arcgis.com/python/sample-notebooks/vehicle-detection-and-tracking/

I located the below link, which referenced the model and used the model with the predict_video function to obtain an output for object detection and tracking. I used the from_model_path to input the path location of the deep learning package containing the model on ArcGIS Online.

Below is the script used without the deep learning package path included. 

model = Model()
mdl = model.from_model_path("deep learning package path on the ArcGIS Online")

However, when I used the mdl with the predict_video function (below), I received an AttributeError: 'NoneType' object has no attribute 'predict_video'.

mdl.predict_video(
input_video_path=video_file,
metadata_file='metadata_file.csv',
track=True,
visualize=True,
threshold=0.5,
resize=True)

https://developers.arcgis.com/python/guide/object-detection-and-tracking-on-videos/

Thank you for any assistance in resolving this AttributeError.

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

mdl = model.from_model_path....

returned None... throw a print statement in after that line to ensure that you are getting the correct input for the next step


... sort of retired...
0 Kudos
NatalieDobbs1
New Contributor II

@DanPatterson The print statement after the from_model_path function output none. 

The API reference documentation did not detail a return for the from_model_path function.

https://developers.arcgis.com/python/api-reference/arcgis.learn.toc.html#retinanet

I am unsure of the next step I should take to get the model to work with the predict_video function.

 

0 Kudos