# Approach fpr extracting/cropping features images using deeplearning and no annotations

Let's say I want to have a bunch of images of hats from videos. How would I priniciple build something that would learn to recognize, and crop or bound box hats? I heard you need a dataset with bounding boxes manually drawn for training, but it seems there would be a way for a nn to identify that on their own?

I'm trying to understand the possibility of scraping video for different items. I.e. give it images of 1000 hats, and then it will crop out images of hats from a bunch of video files.

I am thinking this could be an interesting thing to work on, but would need some advicein terms of how to arrpoach it.

Also, the next logical thing is then to put hats on people in movies somehow, but that would be phase 2.

Thanks

A much more trivial, but easier to implement solution is to train a hat classifier $$C$$, which takes in an image or image patch, and output whether the patch contains a hat or not. Using your cropped hat dataset as the true positives, and getting true negatives by randomly cropping patches from any random dataset of images, you can train $$C$$. Given a video, you then simply use a sliding window approach, where for every image patch at every frame, you run $$C$$ on it. You can then threshold the output of $$C$$ and/or crop out areas with high values from the classifier.