|
1 ano atrás | |
---|---|---|
.. | ||
models | 4 anos atrás | |
videos | 4 anos atrás | |
README.md | 1 ano atrás | |
inference.py | 3 anos atrás | |
requirements.txt | 4 anos atrás |
This repository contains code for RAFT: Optical Flow estimation using Deep Learning blogpost.
git clone git@github.com:princeton-vl/RAFT.git
or
git clone https://github.com/princeton-vl/RAFT.git
Please, attention! There is an option that authors can update their repo and our script will become non-working. To avoid this case, we saved the suitable version of the RAFT architecture in our GitHub, so you can download it from there.
virtualenv -p python3.7 venv
source venv/bin/activate
and install the required libraries:
pip install -r requirements.txt
./RAFT/download_models.sh
python3 inference.py --model=./models/raft-sintel.pth --video ./videos/crowd.mp4
or with RAFT-S
python3 inference.py --model=./models/raft-small.pth --video ./videos/crowd.mp4 --small
Follow the instructions here to quickly run the RAFT example code using a pre-configured Docker image.
If you have two GPUs and there is a User Warning like:
UserWarning:
There is an imbalance between your GPUs. You may want to exclude GPU 1 which
has less than 75% of the memory or cores of GPU 0. You can do so by setting
the device_ids argument to DataParallel, or by setting the CUDA_VISIBLE_DEVICES
environment variable.
with the following error such as:
TypeError: forward() missing 2 required positional arguments: 'image1' and 'image2'
one of the solution is to set the environment variable CUDA_VISIBLE_DEVICES
on our own:
$ export CUDA_VISIBLE_DEVICES=0
where 0
is the id number of the one of your GPUs.
Want to become an expert in AI? AI Courses by OpenCV is a great place to start.