Image processing and object detection from another source than board camera

Hello,

For object or face detection, I would like to use this powerful board for analysis and set as an input either:
1- a JPG image
2-a rtsp stream from an other home camera

How to implement this ?

Thanks

https://www.amebaiot.com/en/amebapro2-amb82-mini-arduino-peripherals-examples/

How to analyse or detect object when the input is a JPEG file ?