-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tracking with OpenCV #1003
Add Tracking with OpenCV #1003
Changes from all commits
9c16460
2290a6a
6168c7c
e5f7f06
4ee7d99
9bc60e0
5f71b01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,17 @@ wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_co | |
export AUTO_SEGMENTATION_PATH="/path/to/dir" # dir must contain mask_rcnn_coco.h5 file | ||
``` | ||
|
||
### Tracking | ||
- Download the GOTURN model if the the OpenCV GOTURN tracker is to be used. | ||
```sh | ||
#This downloads it into the cvat folder | ||
components/tracking/install.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Root directory doesn't look as a right place. Or take a look in a direction (investigate) of using docker volumes / mounted shares with large models. |
||
``` | ||
- Add next lines to ``.env/bin/activate``: | ||
```sh | ||
export TRACKING="yes" | ||
``` | ||
|
||
## JavaScript/Typescript coding style | ||
|
||
We use the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) for JavaScript code with a | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,13 @@ RUN if [ "$AUTO_SEGMENTATION" = "yes" ]; then \ | |
bash -i /tmp/components/auto_segmentation/install.sh; \ | ||
fi | ||
|
||
ARG TRACKING | ||
ENV TRACKING=${TRACKING} | ||
ENV TRACKING_PATH=${HOME}/tracking | ||
RUN if [ "$TRACKING" = "yes" ]; then \ | ||
bash -i /tmp/components/tracking/install.sh; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tracking may be used without GOTURN. |
||
fi | ||
|
||
ARG WITH_TESTS | ||
RUN if [ "$WITH_TESTS" = "yes" ]; then \ | ||
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Tracking | ||
This components allows to track bounding boxes in consecutive images. | ||
|
||
### Build docker image | ||
```bash | ||
# From project root directory | ||
docker-compose -f docker-compose.yml -f components/tracking/docker-compose.tracking.yml build | ||
``` | ||
|
||
### Run docker container | ||
```bash | ||
# From project root directory | ||
docker-compose -f docker-compose.yml -f components/tracking/docker-compose.tracking.yml up -d | ||
``` | ||
|
||
### TODO | ||
* Make API consistent (one request per tracking job) | ||
* Put jobs into queque | ||
* Enable by default? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (C) 2018 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
version: "2.3" | ||
|
||
services: | ||
cvat: | ||
build: | ||
context: . | ||
args: | ||
TRACKING: "yes" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Install GOTURN model for OpenCV; It is not in a package and has to be downloaded | ||
cd "$(dirname "$0")" | ||
echo "Downloading GOTURN model. This can take a while." | ||
wget -q 'https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt' | ||
wget -q 'https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001' | ||
wget -q 'https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002' | ||
wget -q 'https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003' | ||
wget -q 'https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004' | ||
cat goturn.caffemodel.zip* > goturn.caffemodel.zip | ||
unzip goturn.caffemodel.zip | ||
mv goturn.caffemodel goturn.prototxt ../.. | ||
rm goturn.caffemodel.zip* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
# Copyright (C) 2018-2019 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
from cvat.settings.base import JS_3RDPARTY | ||
|
||
# default_app_config = 'cvat.apps.tracking.apps.TrackingConfig' | ||
|
||
JS_3RDPARTY['engine'] = JS_3RDPARTY.get('engine', []) + ['tracking/js/enginePlugin.js'] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Copyright (C) 2018 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
# Register your models here. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# Copyright (C) 2018 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class TrackingConfig(AppConfig): | ||
name = 'tracking' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
# Copyright (C) 2018 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Copyright (C) 2018 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
# Create your models here. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this model is very large. So placing it in source tree would lead to docker builds slowdown.
What is about
.dockerignore
? (if you want to add it where)Or remove from both places.