-
To create a dataset of indoor and outdoor images
-
To train a model to identify images as belonging to the indoor or outdoor class
-
To build a CLI tool to input images one by one, and for the tool to predict the class that the image belongs to
I used the script from this codebase to extract relevant videos from the YouTube-8m dataset. The categories I queried for indoor images were Room, Bedroom, Classroom, Office, Gym, Couch, Cooking, and Chair. The categories I queried for outdoor images were Beach, Landscape, Skyscraper, Mountain, Hiking, Skiing, Weather, and Thunderstorm. After obtaining these videos, I extracted 5 frames from each video to create a dataset of images.
I used a pretrained VGG16 model, excluding the fully connected layers. Instead, I added fully connected layers of my own, and trained only those layers on the dataset that I had collected. Due to the lack of compute power on my local machine, I trained it only for 5 epochs. I was able to obtain a validation accuracy of 79.92%.
I then created a command line tool called "mytool", which would take an image path as an argument, and would output whether the image was taken indoors or outdoors.
- Install python 2.7
- Install virtualenv
- Clone this repository
- cd into this repository
- Create a virtual environment
- Run
pip install -r requirements.txt
- Run
python setup.py install
- Run
mytool --img img_name
whereimg_name
is the path to an image of your choice
utils.py
was used to create the dataset. It was run as python utils.py indoor
or python utils.py outdoor
depending upon the data I was creating.
model.py
contains the code for training the deep learning model. It took no other arguments, and simply ran with 'python model.py'
unit_test.py
contains a few test units that I wrote
It contains a directory titled photos
, which contains the dataset I created.
It was in this folder that I had two other folders, each containing the indoor and outdoor videos respectively. Due to the size of the videos, I did not upload them onto github.
It also has two bash scripts, which were used to make the data processing more convenient.