Core code of object detection in Tensorflow, can be used to test models.
- detect_in_image: Detects or objects in a given image due to given Tensorflow model
- detect_in_video: Detects and objects in a given video due to given Tensorflow model
๐ฎโโ๏ธ Make sure that you have OpenCV and Tensorflow already installed
- Clone or download this repo
- Open src folder in CMD
- Run:
python detect_in_image.py --input_image <PATH_TO_INPUT_JPG_FILE> --output_image <PATH_TO_OUTPUT_JPG_FILE> --model_path <PATH_TO_INPUT_PB_FILE> --threshold <THRESHOLD>
- Run:
python detect_in_video.py --input_video <PATH_TO_INPUT_MP4_FILE> --output_image <PATH_TO_OUTPUT_MP4_FILE> --model_path <PATH_TO_INPUT_PB_FILE> --threshold <THRESHOLD>
- TADAA ๐ It's done ๐ค
- Press Q to stop
To see running options run for all codes:
python detect_in_video.py --help
๐ฎโโ๏ธ Thrshold value should be between 0 and 1.
Find me on LinkedIn and feel free to mail me, Asmaa ๐ฆ