A CNN-based image classifier capable of detecting if a scene is indoors or outdoors.
This repository contains scripts for downloading videos corresponding to a particular or a few categories of youtube-8m dataset.
Python dependencies for the classification task
- Numpy
- Sklearn
- Tensorflow
- Keras
- tqdm
- PyYaml
- pytest
Dependencies for downloading youtube videos from ids
Dependencies for generation of frames from videos
Dependences for image preprocessing and resizing
$ pip3 install -r requirements.txt
This CLI will run the pretrained model on a provided image.
bash classify.sh config/train_params.yml data/test/indoor_test.jpg
An example dataset composed by 600 YouTube videos, for a total of 60.000 video frames, is availale here. The videos belong to different category, according to the youtube-8m dataset.
The dataset contains instances from the following categories, labeled as follows:
Living_room indoor
Bedroom indoor
Dining_room indoor
Garden outdoor
Outdoor_recreation outdoor
Hiking outdoor
Prepare the test environment downloading the provided dataset excerpt:
$ cd indoor-outdoor-image-classifier
$ wget http://insidecode.it/indoor-outdoor-data_64.zip
$ unzip indoor-outdoor-data_64.zip
This will test the performance of the model on the test split and run a simple unit test on two benchmark images.
$ bash evaluate.sh config/train_params.yml indoor-outdoor-data_64/frames
It is possible to tune the model parameters defining a new configuration file (following the default one in config/train_params.yml) and train the new model using the following command:
$ bash train.sh <config-file> <image-directory-path>