• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    Python
  • Created over 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for "Towards Segmenting Anything That Moves"

Towards Segmenting Anything That Moves

[Pre-print] [Website]

Achal Dave, Pavel Tokmakov, Deva Ramanan

Setup

  1. Download models and extract them to release/models
  2. Install pytorch 0.4.0.
  3. Run git submodule update --init.
  4. Setup detectron-pytorch.
  5. Setup flownet2. If you just want to use the appearance stream, you can skip this step.
  6. Install requirements with pip install -r requirements.txt1.
  7. Copy ./release/example_config.yaml to ./release/config.yaml, and edit fields marked with ***EDIT THIS***.
  8. Add root directory to PYTHONPATH: source ./env.sh activate.

Running models

All scripts needed for running our models on standard datasets, as well as on new videos, are provided in the ./release directory. Outside of the release directory, this repository contains a number of scripts which are not used for the final results. They can be safely ignored, but are provided in case anyone finds them useful.

Run on your own video

  1. Extract frames: To run the model on your own video, first dump the frames from your video. For a single video, you can just use

    ffmpeg -i video.mp4 %04d.jpg

    Alternatively, you can use this script to extract frames in parallel on multiple videos.

  2. Run joint model: To run the joint model, run the following commands:

    # Inputs
    FRAMES_DIR=/path/to/frames/dir
    # Outputs
    OUTPUT_DIR=/path/to/output/dir
    
    python release/custom/run.py \
    --model joint \
    --frames-dir ${FRAMES_DIR} \
    --output-dir ${OUTPUT_DIR}
  3. Run appearance only model: To run only the appearance model, you don't need to compute optical flow, or set up flownet2:

    python release/custom/run.py \
    --model appearance \
    --frames-dir ${FRAMES_DIR} \
    --output-dir ${OUTPUT_DIR}

FBMS, DAVIS 2016/2017, YTVOS

The instructions for FBMS, DAVIS 2016/2017 and YTVOS datasets are roughly the same. Once you have downloaded the dataset and edited the paths in ./release/config.yaml, run the following scripts:

# or davis16, davis17, ytvos
dataset=fbms
python release/${dataset}/compute_flow.py
python release/${dataset}/infer.py
python release/${dataset}/track.py
# For evaluation:
python release/${dataset}/evaluate.py

Note that by default, we use our final model trained on COCO, FlyingThings3D, DAVIS, and YTVOS. For YTVOS, we provide the option to run using a model that was trained without YTVOS, to evaluate generalization. To activate this, pass --without-ytvos-train to release/ytvos/infer.py and release/ytvos/track.py.


1: This should contain all the requirements, but this was created manually so I may be missing some pip modules. If you run into an import error, try pip installing the module, and/or file an issue.

More Repositories

1

vid

Command line tool for common video manipulations
Python
41
star
2

large-vocab-devil

Python
34
star
3

Video-Visualizer

Visualize videos, groundtruth annotations, and predictions
JavaScript
18
star
4

Vimdows-Navigation

Use certain vim keyboard commands anywhere in Windows.
AutoHotkey
17
star
5

pytorch-extract-features

Python
16
star
6

predictive-corrective

Code for "Predictive-Corrective Networks for Action Detection"
Lua
16
star
7

video-tools

Utilities for working with videos
Python
8
star
8

Paint-Android-App

Assignment 2 for CS160, a simple-ish drawing app
Java
7
star
9

segment-any-moving_detectron

Detectron.pytorch fork used for "Towards Segmenting Anything That Moves" code
Python
5
star
10

Kannada-Text-Detection

MATLAB
4
star
11

dotfiles

Dotfiles, mainly using repo to sync across machines
Shell
4
star
12

average-precision

Average precision in various languages
Python
4
star
13

twitter_sentiment

Naive Bayes classifier for twitter sentiment.
Python
3
star
14

Audio-API-Frequency-Generator

Messing with the Audio API
JavaScript
3
star
15

thumos-util

Utilities for working with THUMOS
MATLAB
2
star
16

thumos-scripts

Python
2
star
17

Desktop-Cleanup

Cleans and organizes the files on your desktop based on their file type
PowerShell
2
star
18

Google-by-Image-Restartless

Google by Image Restartless addon for Firefox; relatively simple, built on Addon SDK
JavaScript
2
star
19

fbms-evaluation

Some fixes to Freiburg Berkeley Motion Segmentation evaluation code
C++
1
star
20

charades-scripts

Python
1
star
21

Glass-QR

Uses zxing library for qr detection/recognition
Java
1
star
22

Seen-Rejected-Chrome

JavaScript
1
star
23

ffmpeg-incantations

A place to keep track of strange incantations of ffmpeg for future reference
Shell
1
star
24

python-script-utils

Common utils for python scripts
Python
1
star
25

network-feature-extraction

Dump features from a pretrained Caffenet model
Python
1
star