agermanidis/thingscoop
{ "createdAt": "2015-07-28T23:48:15Z", "defaultBranch": "master", "description": "Search and filter videos based on objects that appear in them using convolutional neural networks", "fullName": "agermanidis/thingscoop", "homepage": "", "language": "Python", "name": "thingscoop", "pushedAt": "2016-05-11T16:26:37Z", "stargazersCount": 358, "topics": [], "updatedAt": "2025-08-13T01:04:59Z", "url": "https://github.com/agermanidis/thingscoop"}
Thingscoop: Utility for searching and filtering videos based on their content
Section titled “Thingscoop: Utility for searching and filtering videos based on their content”Description
Section titled “Description”Thingscoop is a command-line utility for analyzing videos semantically - that means searching, filtering, and describing videos based on objects, places, and other things that appear in them.
When you first run thingscoop on a video file, it uses a convolutional neural network to create an “index” of what’s contained in the every second of the input by repeatedly performing image classification on a frame-by-frame basis. Once an index for a video file has been created, you can search (i.e. get the start and end times of the regions in the video matching the query) and filter (i.e. create a supercut of the matching regions) the input using arbitrary queries. Thingscoop uses a very basic query language that lets you to compose queries that test for the presence or absence of labels with the logical operators ! (not), || (or) and && (and). For example, to search a video the presence of the sky and the absence of the ocean: thingscoop search 'sky && !ocean' <file>.
Right now two models are supported by thingscoop: vgg_imagenet uses the architecture described in “Very Deep Convolutional Networks for Large-Scale Image Recognition” to recognize objects from the ImageNet database, and googlenet_places uses the architecture described in “Going Deeper with Convolutions” to recognize settings and places from the MIT Places database. You can specify which model you’d like to use by running thingscoop models use <model>, where <model> is either vgg_imagenet or googlenet_places. More models will be added soon.
Thingscoop is based on Caffe, an open-source deep learning framework.
Installation
Section titled “Installation”- Install ffmpeg, imagemagick, and ghostscript:
brew install ffmpeg imagemagick ghostscript(Mac OS X) orapt-get install ffmpeg imagemagick ghostscript(Ubuntu). - Follow the installation instructions on the Caffe Installation page.
- Make sure you build the Python bindings by running
make pycaffe(on Caffe’s directory). - Set the environment variable CAFFE_ROOT to point to Caffe’s directory:
export CAFFE_ROOT=[Caffe's directory]. - Install thingscoop:
easy_install thingscooporpip install thingscoop.
thingscoop search <query> <files...>
Section titled “thingscoop search <query> <files...>”Print the start and end times (in seconds) of the regions in <files> that match <query>. Creates an index for <file> using the current model if it does not exist.
Example output:
$ thingscoop search violin waking_life.mp4/Users/anastasis/Downloads/waking_life.mp4 148.000000 162.000000/Users/anastasis/Downloads/waking_life.mp4 176.000000 179.000000/Users/anastasis/Downloads/waking_life.mp4 180.000000 186.000000/Users/anastasis/Downloads/waking_life.mp4 189.000000 190.000000/Users/anastasis/Downloads/waking_life.mp4 192.000000 200.000000/Users/anastasis/Downloads/waking_life.mp4 211.000000 212.000000/Users/anastasis/Downloads/waking_life.mp4 222.000000 223.000000/Users/anastasis/Downloads/waking_life.mp4 235.000000 243.000000/Users/anastasis/Downloads/waking_life.mp4 247.000000 249.000000/Users/anastasis/Downloads/waking_life.mp4 251.000000 253.000000/Users/anastasis/Downloads/waking_life.mp4 254.000000 258.000000####thingscoop filter <query> <files...>
Generate a video compilation of the regions in the <files> that match <query>. Creates index for <file> using the current model if it does not exist.
Example output:
thingscoop sort <file>
Section titled “thingscoop sort <file>”Create a compilation video showing examples for every label recognized in the video (in alphabetic order). Creates an index for <file> using the current model if it does not exist.
Example output:
thingscoop describe <file>
Section titled “thingscoop describe <file>”Print every label that appears in <file> along with the number of times it appears. Creates an index for <file> using the current model if it does not exist.
thingscoop preview <file>
Section titled “thingscoop preview <file>”Create a window that plays the input video <file> while also displaying the labels the model recognizes on every frame.
$ thingscoop describe koyaanisqatsi.mp4 -m googlenet_placessky 405skyscraper 363canyon 141office_building 130highway 78lighthouse 66hospital 64desert 59shower 49volcano 45underwater 44airport_terminal 43fountain 39runway 36assembly_line 35aquarium 34fire_escape 34music_studio 32bar 28amusement_park 28stage 26wheat_field 25butchers_shop 25engine_room 24slum 20butte 20igloo 20...etcthingscoop index <file>
Section titled “thingscoop index <file>”Create an index for <file> using the current model if it does not exist.
thingscoop models list
Section titled “thingscoop models list”List all models currently available in Thingscoop.
$ thingscoop models listgooglenet_imagenet Model described in the paper "Going Deeper with Convolutions" trained on the ImageNet databasegooglenet_places Model described in the paper "Going Deeper with Convolutions" trained on the MIT Places databasevgg_imagenet 16-layer model described in the paper "Return of the Devil in the Details: Delving Deep into Convolutional Nets" trained on the ImageNet databasethingscoop models info <model>
Section titled “thingscoop models info <model>”Print more detailed information about <model>.
$ thingscoop models info googlenet_placesName: googlenet_placesDescription: Model described in the paper "Going Deeper with Convolutions" trained on the MIT Places databaseDataset: MIT Placesthingscoop models freeze
Section titled “thingscoop models freeze”List all models that have already been downloaded.
$ thingscoop models freezegooglenet_placesvgg_imagenetthingscoop models current
Section titled “thingscoop models current”Print the model that is currently in use.
$ thingscoop models currentgooglenet_placesthingscoop models use <model>
Section titled “thingscoop models use <model>”Set the current model to <model>. Downloads that model locally if it hasn’t been downloaded already.
thingscoop models download <model>
Section titled “thingscoop models download <model>”Download the model <model> locally.
thingscoop models remove <model>
Section titled “thingscoop models remove <model>”Remove the model <model> locally.
thingscoop models clear
Section titled “thingscoop models clear”Remove all models stored locally.
thingscoop labels list
Section titled “thingscoop labels list”Print all the labels used by the current model.
$ thingscoop labels listabacusabayaabstractionacademic gownaccessoryaccordionacornacorn squashacoustic guitaractactinic radiationactionactivityadhesive bandageadjudicatoradministrative districtadmiraladornmentadventureradvocate...thingscoop labels search <regexp>
Section titled “thingscoop labels search <regexp>”Print all the labels supported by the current model that match the regular expression <regexp>.
$ thingscoop labels search instrument$beating-reed instrumentbowed stringed instrumentdouble-reed instrumentfree-reed instrumentinstrumentkeyboard instrumentmeasuring instrumentmedical instrumentmusical instrumentnavigational instrumentnegotiable instrumentoptical instrumentpercussion instrumentscientific instrumentstringed instrumentsurveying instrumentwind instrument...Full usage options
Section titled “Full usage options”thingscoop - Command-line utility for searching and filtering videos based on their content
Usage: thingscoop filter <query> <files>... [-o <output_path>] [-m <model>] [-s <sr>] [-c <mc>] [--recreate-index] [--gpu-mode] [--open] thingscoop search <query> <files>... [-o <output_path>] [-m <model>] [-s <sr>] [-c <mc>] [--recreate-index] [--gpu-mode] thingscoop describe <file> [-n <words>] [-m <model>] [--recreate-index] [--gpu-mode] [-c <mc>] thingscoop index <files> [-m <model>] [-s <sr>] [-c <mc>] [-r <ocr>] [--recreate-index] [--gpu-mode] thingscoop sort <file> [-m <model>] [--gpu-mode] [--min-confidence <ct>] [--max-section-length <ms>] [-i <ignore>] [--open] thingscoop preview <file> [-m <model>] [--gpu-mode] [--min-confidence <ct>] thingscoop labels list [-m <model>] thingscoop labels search <regexp> [-m <model>] thingscoop models list thingscoop models info <model> thingscoop models freeze thingscoop models current thingscoop models use <model> thingscoop models download <model> thingscoop models remove <model> thingscoop models clear
Options: --version Show version. -h --help Show this screen. -o --output <dst> Output file for supercut -s --sample-rate <sr> How many frames to classify per second (default = 1) -c --min-confidence <mc> Minimum prediction confidence required to consider a label (default depends on model) -m --model <model> Model to use (use 'thingscoop models list' to see all available models) -n --number-of-words <words> Number of words to describe the video with (default = 5) -t --max-section-length <ms> Max number of seconds to show examples of a label in the sorted video (default = 5) -r --min-occurrences <ocr> Minimum number of occurrences of a label in video required for it to be shown in the sorted video (default = 2) -i --ignore-labels <labels> Labels to ignore when creating the sorted video video --title <title> Title to show at the beginning of the video (sort mode only) --gpu-mode Enable GPU mode --recreate-index Recreate object index for file if it already exists --open Open filtered video after creating it (OS X only)CHANGELOG
Section titled “CHANGELOG”0.2 (8/16/2015)
Section titled “0.2 (8/16/2015)”- Added
sortoption for creating a video compilation of all labels appearing in a video - Now using JSON for the index files
0.1 (8/5/2015)
Section titled “0.1 (8/5/2015)”- Conception
License
Section titled “License”MIT