How to perform image detection operation on saved image?