bilylee / SiamFC-TensorFlow

A TensorFlow implementation of the SiamFC tracker
MIT License
358 stars 112 forks source link

Model Inference Taking ".jpg" files List #109

Closed AliWaheed closed 4 years ago

AliWaheed commented 4 years ago

Hi, I would like to run "run_tracking.py" on Numpy files rather than passing the list of ".jpgs" I followed the inference session and saw that you are providing jpg list right to your model for inference. Can you please guide a bit on how can I run inference on Numpy images.

bilylee commented 4 years ago

For the best efficiency, it is recommended to use jpeg images. The reason is that TensorFlow supports directly reading jpeg images from the file system.

To your question, one choice is to convert NumPy files to jpeg images, then run the tracking script. Nevertheless, it is also possible to use Numpy files with some modifications.

  1. modify the input pipeline of the computation graph to use Numpy array instead of jpeg filenames

https://github.com/bilylee/SiamFC-TensorFlow/blob/f572dca95f2b3b2861f54de467259753428e468c/inference/inference_wrapper.py#L80-L84

  1. change the feed_dict to use Numpy array instead of filename

https://github.com/bilylee/SiamFC-TensorFlow/blob/f572dca95f2b3b2861f54de467259753428e468c/inference/inference_wrapper.py#L226

https://github.com/bilylee/SiamFC-TensorFlow/blob/f572dca95f2b3b2861f54de467259753428e468c/inference/inference_wrapper.py#L237

  1. change the input_feed during tracking

https://github.com/bilylee/SiamFC-TensorFlow/blob/f572dca95f2b3b2861f54de467259753428e468c/inference/tracker.py#L57

https://github.com/bilylee/SiamFC-TensorFlow/blob/f572dca95f2b3b2861f54de467259753428e468c/inference/tracker.py#L78

AliWaheed commented 4 years ago

Thank you for such quick reply. I will check it out and report back