Giter Site home page Giter Site logo

geekalexis / fastmot Goto Github PK

View Code? Open in Web Editor NEW
1.1K 25.0 253.0 119.56 MB

High-performance multiple object tracking based on YOLO, Deep SORT, and KLT 🚀

License: MIT License

Python 88.12% C++ 2.43% Shell 1.08% Makefile 0.50% Cuda 6.35% Dockerfile 1.52%
jetson multi-object-tracking tensorrt real-time reid object-detection deep-sort computer-vision yolov4 ssd

fastmot's Introduction

FastMOT

Hits License: MIT DOI

News

  • (2021.8.17) Support multi-class tracking
  • (2021.7.4) Support yolov4-p5 and yolov4-p6
  • (2021.2.13) Support Scaled-YOLOv4 (i.e. yolov4-csp/yolov4x-mish/yolov4-csp-swish)
  • (2021.1.3) Add DIoU-NMS for postprocessing
  • (2020.11.28) Docker container provided for x86 Ubuntu

Description

FastMOT is a custom multiple object tracker that implements:

  • YOLO detector
  • SSD detector
  • Deep SORT + OSNet ReID
  • KLT tracker
  • Camera motion compensation

Two-stage trackers like Deep SORT run detection and feature extraction sequentially, which often becomes a bottleneck. FastMOT significantly speeds up the entire system to run in real-time even on Jetson. Motion compensation improves tracking for scenes with moving camera, where Deep SORT and FairMOT fail.

To achieve faster processing, FastMOT only runs the detector and feature extractor every N frames, while KLT fills in the gaps efficiently. FastMOT also re-identifies objects that moved out of frame to keep the same IDs.

YOLOv4 was trained on CrowdHuman (82% [email protected]) and SSD's are pretrained COCO models from TensorFlow. Both detection and feature extraction use the TensorRT backend and perform asynchronous inference. In addition, most algorithms, including KLT, Kalman filter, and data association, are optimized using Numba.

Performance

Results on MOT20 train set

Detector Skip MOTA IDF1 HOTA MOTP MT ML
N = 1 66.8% 56.4% 45.0% 79.3% 912 274
N = 5 65.1% 57.1% 44.3% 77.9% 860 317

FPS on MOT17 sequences

Sequence Density FPS
MOT17-13 5 - 30 42
MOT17-04 30 - 50 26
MOT17-03 50 - 80 18

Performance is evaluated with YOLOv4 using TrackEval. Note that neither YOLOv4 nor OSNet was trained or finetuned on the MOT20 dataset, so train set results should generalize well. FPS results are obtained on Jetson Xavier NX (20W 2core mode).

FastMOT has MOTA scores close to state-of-the-art trackers from the MOT Challenge. Increasing N shows small impact on MOTA. Tracking speed can reach up to 42 FPS depending on the number of objects. Lighter models (e.g. YOLOv4-tiny) are recommended for a more constrained device like Jetson Nano. FPS is expected to be in the range of 50 - 150 on desktop CPU/GPU.

Requirements

  • CUDA >= 10
  • cuDNN >= 7
  • TensorRT >= 7
  • OpenCV >= 3.3
  • Numpy >= 1.17
  • Scipy >= 1.5
  • Numba == 0.48
  • CuPy == 9.2
  • TensorFlow < 2.0 (for SSD support)

Install for x86 Ubuntu

Make sure to have nvidia-docker installed. The image requires NVIDIA Driver version >= 450 for Ubuntu 18.04 and >= 465.19.01 for Ubuntu 20.04. Build and run the docker image:

# Add --build-arg TRT_IMAGE_VERSION=21.05 for Ubuntu 20.04
# Add --build-arg CUPY_NVCC_GENERATE_CODE=... to speed up build for your GPU, e.g. "arch=compute_75,code=sm_75"
docker build -t fastmot:latest .

# Run xhost local:root first if you cannot visualize inside the container
docker run --gpus all --rm -it -v $(pwd):/usr/src/app/FastMOT -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -e TZ=$(cat /etc/timezone) fastmot:latest

Install for Jetson Nano/TX2/Xavier NX/Xavier

Make sure to have JetPack >= 4.4 installed and run the script:

./scripts/install_jetson.sh

Download models

Pretrained OSNet, SSD, and my YOLOv4 ONNX model are included.

./scripts/download_models.sh

Build YOLOv4 TensorRT plugin

cd fastmot/plugins
make

Download VOC dataset for INT8 calibration

Only required for SSD (not supported on Ubuntu 20.04)

./scripts/download_data.sh

Usage

  python3 app.py --input-uri ... --mot
  • Image sequence: --input-uri %06d.jpg
  • Video file: --input-uri file.mp4
  • USB webcam: --input-uri /dev/video0
  • MIPI CSI camera: --input-uri csi://0
  • RTSP stream: --input-uri rtsp://<user>:<password>@<ip>:<port>/<path>
  • HTTP stream: --input-uri http://<user>:<password>@<ip>:<port>/<path>

Use --show to visualize, --output-uri to save output, and --txt for MOT compliant results.

Show help message for all options:

  python3 app.py -h

Note that the first run will be slow due to Numba compilation. To use the FFMPEG backend on x86, set WITH_GSTREAMER = False here

More options can be configured in cfg/mot.json
  • Set resolution and frame_rate that corresponds to the source data or camera configuration (optional). They are required for image sequence, camera sources, and saving txt results. List all configurations for a USB/CSI camera:
    v4l2-ctl -d /dev/video0 --list-formats-ext
  • To swap network, modify model under a detector. For example, you can choose from SSDInceptionV2, SSDMobileNetV1, or SSDMobileNetV2 for SSD.
  • If more accuracy is desired and FPS is not an issue, lower detector_frame_skip. Similarly, raise detector_frame_skip to speed up tracking at the cost of accuracy. You may also want to change max_age such that max_age × detector_frame_skip ≈ 30
  • Modify visualizer_cfg to toggle drawing options.
  • All parameters are documented in the API.

Track custom classes

FastMOT can be easily extended to a custom class (e.g. vehicle). You need to train both YOLO and a ReID network on your object class. Check Darknet for training YOLO and fast-reid for training ReID. After training, convert weights to ONNX format. The TensorRT plugin adapted from tensorrt_demos is only compatible with Darknet.

FastMOT also supports multi-class tracking. It is recommended to train a ReID network for each class to extract features separately.

Convert YOLO to ONNX

  1. Install ONNX version 1.4.1 (not the latest version)
    pip3 install onnx==1.4.1
  2. Convert using your custom cfg and weights
    ./scripts/yolo2onnx.py --config yolov4.cfg --weights yolov4.weights

Add custom YOLOv3/v4

  1. Subclass fastmot.models.YOLO like here:
    class YOLOv4(YOLO):
    ENGINE_PATH = Path(__file__).parent / 'yolov4_crowdhuman.trt'
    MODEL_PATH = Path(__file__).parent / 'yolov4_crowdhuman.onnx'
    NUM_CLASSES = 2
    INPUT_SHAPE = (3, 512, 512)
    LAYER_FACTORS = [8, 16, 32]
    SCALES = [1.2, 1.1, 1.05]
    ANCHORS = [[11,22, 24,60, 37,116],
    [54,186, 69,268, 89,369],
    [126,491, 194,314, 278,520]]
    ENGINE_PATH : Path
        Path to TensorRT engine.
        If not found, TensorRT engine will be converted from the ONNX model
        at runtime and cached for later use.
    MODEL_PATH : Path
        Path to ONNX model.
    NUM_CLASSES : int
        Total number of trained classes.
    LETTERBOX : bool
        Keep aspect ratio when resizing.
    NEW_COORDS : bool
        new_coords Darknet parameter for each yolo layer.
    INPUT_SHAPE : tuple
        Input size in the format `(channel, height, width)`.
    LAYER_FACTORS : List[int]
        Scale factors with respect to the input size for each yolo layer.
    SCALES : List[float]
        scale_x_y Darknet parameter for each yolo layer.
    ANCHORS : List[List[int]]
        Anchors grouped by each yolo layer.
    
    Note anchors may not follow the same order in the Darknet cfg file. You need to mask out the anchors for each yolo layer using the indices in mask in Darknet cfg. Unlike YOLOv4, the anchors are usually in reverse for YOLOv3 and YOLOv3/v4-tiny
  2. Set class labels to your object classes with fastmot.models.set_label_map
  3. Modify cfg/mot.json: set model in yolo_detector_cfg to the added Python class name and set class_ids of interest. You may want to play with conf_thresh based on model performance

Add custom ReID

  1. Subclass fastmot.models.ReID like here:
    class OSNet025(ReID):
    ENGINE_PATH = Path(__file__).parent / 'osnet_x0_25_msmt17.trt'
    MODEL_PATH = Path(__file__).parent / 'osnet_x0_25_msmt17.onnx'
    INPUT_SHAPE = (3, 256, 128)
    OUTPUT_LAYOUT = 512
    METRIC = 'euclidean'
    ENGINE_PATH : Path
        Path to TensorRT engine.
        If not found, TensorRT engine will be converted from the ONNX model
        at runtime and cached for later use.
    MODEL_PATH : Path
        Path to ONNX model.
    INPUT_SHAPE : tuple
        Input size in the format `(channel, height, width)`.
    OUTPUT_LAYOUT : int
        Feature dimension output by the model.
    METRIC : {'euclidean', 'cosine'}
        Distance metric used to match features.
    
  2. Modify cfg/mot.json: set model in feature_extractor_cfgs to the added Python class name. For more than one class, add more feature extractor configurations to the list feature_extractor_cfgs. You may want to play with max_assoc_cost and max_reid_cost based on model performance

Citation

If you find this repo useful in your project or research, please star and consider citing it:

@software{yukai_yang_2020_4294717,
 author       = {Yukai Yang},
 title        = {{FastMOT: High-Performance Multiple Object Tracking Based on Deep SORT and KLT}},
 month        = nov,
 year         = 2020,
 publisher    = {Zenodo},
 version      = {v1.0.0},
 doi          = {10.5281/zenodo.4294717},
 url          = {https://doi.org/10.5281/zenodo.4294717}
}

fastmot's People

Contributors

fruchtzwerg94 avatar geekalexis avatar muhammadasadjaved avatar ning-du avatar rafcy avatar sopsos avatar techievena avatar weiyunjiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastmot's Issues

about optical flow

why do you use optical flow to track? is only use deep sort to track?

Unable to read video stream

Hi, I'm having this issue when running the main app.py I've tried with my webcam and external USB one and a path to a video everytime a get the same error. I've installed FastMOT on a Ubuntu 18.04 x86 machine and on a Jetson TX2 following the instructions provided here. I've checked that the camera works fine with a small script using python and opencv.

Here is the error that I recieve everytime:

python3 app.py --g --input_uri /dev/video0 --mot
Traceback (most recent call last):
  File "app.py", line 108, in <module>
    main()
  File "app.py", line 36, in main
    stream = fastmot.VideoIO(config['size'], config['video_io'], args.input_uri, args.output_uri)
  File "/home/raiza/programming/FastMOT/fastmot/videoio.py", line 53, in __init__
    raise RuntimeError('Unable to read video stream')
RuntimeError: Unable to read video stream

LLVM out of memory

I try to run in Xavier NX with a video size of 320x240.
I try YoloV4 and I got this error:

LLVM ERROR: out of memory
Aborted (core dumped)

IndexError: Attribute not found: pads

[INFO] 1280x720 stream @ 30 FPS
[INFO] Loading detector model...
[INFO] Loading feature extractor model...
[INFO] Building engine with batch size: 16
[INFO] This may take a while...
Traceback (most recent call last):
File "app.py", line 108, in
main()
File "app.py", line 45, in main
draw=draw, verbose=args.verbose)
File "/workspace/code/FastMOT/fastmot/mot.py", line 52, in init
self.extractor = FeatureExtractor(config['feature_extractor'])
File "/workspace/code/FastMOT/fastmot/feature_extractor.py", line 18, in init
self.backend = InferenceBackend(self.model, self.batch_size)
File "/workspace/code/FastMOT/fastmot/utils/inference.py", line 38, in init
self.engine = self.model.build_engine(InferenceBackend.TRT_LOGGER, self.batch_size)
File "/workspace/code/FastMOT/fastmot/models/reid.py", line 30, in build_engine
parser.parse(model_file.read())
IndexError: Attribute not found: pads

[Question] How can i run in CPU

Hello. I want run this in my laptop without GPU but i dont know how to build plugin.
Does the respository support pc without CUDA?

IndexError: Attribute not found: pads

When I run app.py, an error appears. I can convert yolov4_crowdhuman.onnx to trt model, but osnet cannot be converted successfully.

cmd:
python3 app.py --input_uri ./video.flv --mot
output:
[INFO] 1280x720 stream @ 25 FPS
[INFO] Loading detector model...
[INFO] Loading feature extractor model...
[INFO] Building engine with batch size: 16
[INFO] This may take a while...
Traceback (most recent call last):
File "app.py", line 109, in
main()
File "app.py", line 47, in main
draw=draw, verbose=args.verbose)
File "/data2/zt/workspace/tracking_workspace/FastMOT-master/fastmot/mot.py", line 54, in init
self.extractor = FeatureExtractor(config['feature_extractor'])
File "/data2/zt/workspace/tracking_workspace/FastMOT-master/fastmot/feature_extractor.py", line 18, in init
self.backend = InferenceBackend(self.model, self.batch_size)
File "/data2/zt/workspace/tracking_workspace/FastMOT-master/fastmot/utils/inference.py", line 41, in init
self.engine = self.model.build_engine(InferenceBackend.TRT_LOGGER, self.batch_size)
File "/data2/zt/workspace/tracking_workspace/FastMOT-master/fastmot/models/reid.py", line 31, in build_engine
if not parser.parse(model_file.read()):
IndexError: Attribute not found: pads

My environment:
TensorRT:7.0.0.11
CUDA:10.2
GPU:Tesla P40

cannot find zipfile directory in one of 4.1.1.zip

Step 9/14 : RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && unzip ${OPENCV_VERSION}.zip && rm ${OPENCV_VERSION}.zip && mv opencv-${OPENCV_VERSION} OpenCV && wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && unzip ${OPENCV_VERSION}.zip && rm ${OPENCV_VERSION}.zip && mv opencv_contrib-${OPENCV_VERSION} OpenCV/opencv_contrib
---> Running in 8f509b59aef3
--2020-12-09 02:01:47-- https://github.com/opencv/opencv/archive/4.1.1.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/opencv/opencv/zip/4.1.1 [following]
--2020-12-09 02:01:49-- https://codeload.github.com/opencv/opencv/zip/4.1.1
Resolving codeload.github.com (codeload.github.com)... 192.30.255.120
Connecting to codeload.github.com (codeload.github.com)|192.30.255.120|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: '4.1.1.zip'

2020-12-09 02:17:23 (14.4 KB/s) - '4.1.1.zip' saved [13688982]

Archive: 4.1.1.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of 4.1.1.zip or
4.1.1.zip.zip, and cannot find 4.1.1.zip.ZIP, period.

numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)

Hello:
When I using SSD detector, I got this error. How can I solve it? Thanks.
#####################
[INFO] 1280x720 stream @ 25 FPS
[INFO] Loading detector model...
[INFO] Loading feature extractor model...
[INFO] Starting video capture...
Traceback (most recent call last):
File "app.py", line 109, in
main()
File "app.py", line 64, in main
mot.step(frame)
File "/home/sihan/spf/FastMOT-master/fastmot/mot.py", line 89, in step
detections = self.detector(self.frame_count, frame)
File "/home/sihan/spf/FastMOT-master/fastmot/detector.py", line 28, in call
return self.postprocess()
File "/home/sihan/spf/FastMOT-master/fastmot/detector.py", line 74, in postprocess
detections = self._merge_dets(detections, tile_ids)
File "/home/sihan/spf/FastMOT-master/fastmot/detector.py", line 92, in _merge_dets
detections = self._merge(detections, tile_ids, self.batch_size, self.merge_thresh)
File "/home/sihan/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File "/home/sihan/.local/lib/python3.6/site-packages/numba/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File "/home/sihan/.local/lib/python3.6/site-packages/numba/six.py", line 668, in reraise
raise value.with_traceback(tb)
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Untyped global name 'iom': cannot determine Numba type of <class 'numba.ir.UndefinedType'>

File "fastmot/detector.py", line 143:
def _merge(dets, tile_ids, num_tile, thresh):

if tile_ids[i] != tile_ids[j] and det.label == other.label:
overlap = iom(det.tlbr, other.tlbr)
^

Run FastMOT over JETSON NANO.

I'm trying to perform tracking and reidentification over pedestrian traffic on Jetson Nano. Can you let me know the performance benchmark of FastMOT on Jetson Nano

update on flow and disable ReID

Thanks for your sharing. Very good MOT.
I read your code about optical flow part. After 5 frames, it will do detection again and associate tracks with new detections. The Kalman filter states will be updated with detection window (mean, cov = self.kf.update(*track.state, det.tlbr, MeasType.DETECTOR)) called by function: self.tracker.update(self.frame_count, detections, embeddings)
But it looks like for optical flow it still use the old keypoints. Should we re-generate keypoints in the new detection window because sometimes there are large gaps between the optical flow window and detection window.

Plugin fails when trying YOLOv4-tiny model

Hey Alexis. Thank you for the great work.

I tried to run YOLOv4-tiny-416 model using an ONNX file converted using https://github.com/jkjung-avt/tensorrt_demos/blob/master/yolo/yolo_to_onnx.py.

However, the engine is not built, since an assertion in the YOLO layer plugin fails.
python: yolo_layer.cu:115: virtual nvinfer1::Dims nvinfer1::YoloLayerPlugin::getOutputDimensions(int, const nvinfer1::Dims*, int): Assertion `inputs[0].d[0] == (mNumClasses + 5) * mNumAnchors' failed.

This is the class that I have added to yolo.py

class YOLOv4_tiny(YOLO):
    ENGINE_PATH = Path(__file__).parent / 'yolov4-tiny-416.trt'
    MODEL_PATH = Path(__file__).parent /  'yolov4-tiny-416.onnx'
    NUM_CLASSES = 90
    INPUT_SHAPE = (3, 416, 416)
    LAYER_FACTORS = [32, 16]
    SCALES = [1.05, 1.05]
    ANCHORS = [[81,82,  135,169,  344,319],
              [10,14,  23,27,  37,58]]

Could you please help me debug this?

Error with pip install requirement: No matching distribution found for tensorflow==1.15.2

The step
pip3 install -r requirement.txt

crashes with the following error:

Collecting tensorflow==1.15.2 (from -r requirement.txt (line 5))
  Could not find a version that satisfies the requirement tensorflow==1.15.2 (from -r requirement.txt (line 5)) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0,
 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.
7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2,
 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow==1.15.2 (from -r requirement.txt (line 5))

This seems strange because there is defenitely a tensorflow==1.15.2 in pypi: https://pypi.org/project/tensorflow/1.15.2/

Errors associated with "app.py"

Hi, I have errors with run the code~I changed the value WITH GSTREAMER = False
I've installed FastMOT on a Ubuntu 18.04/I can't understand what the problem is

1414141441

some errors when run app.py

Hi,
When I run this code, some errors will appear:
python3 app.py --input_uri /root/Code/test_video.mp4 --mot

image

[Question] Use of tiling mechanism for SSD models

Hey @GeekAlexis , I had a query regarding the use of tiles in the SSD models. Are you doing it to create batches and improve inference time? Would it be considerably slower or inaccurate to just pass the whole image, rather than passing individual tiles?

Jetson Nano "killed" error when building engine

Hi,

I'm trying to run this on a jetson nano. I know this isn't a very good option for this repo, but I don't need a lot of frames.
I have managed to run the installation script, and all the necessary steps have been taken.
However, when I try to run the app.py script (full command below), I run into a simple "killed" message.

Is there any way I can get more output, or a way to know what might go wrong?

The command:
python3 app.py --input_uri csi://0 --mot --verbose --gui

The output:

GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 4 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
   Frame Rate = 120.000005 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
[INFO] 1280x720 stream @ 60 FPS
[INFO] Loading detector model...
[INFO] Building engine with batch size: 1
[INFO] This may take a while...
Killed

Thanks in advance

I detect the object which is from the perspective of UAV, and how can I select the datasets?

Hello , I want to detect the person which is from the perspective of UAV, unlike the common perspective on the ground,
from the perspective of UAV, the person is very small , so when i train the reid model and use your recommend FastReID inREADME.md, which datastes i need to select?

if I use Market1501, DukeMTMC, MSMT17 datases to train the reid model, and whether the trained model can be used to detect the person which is from the perspective of UAV?

thank you !

RuntimeError: Unable to load the engine file

[INFO] 1920x1080 stream @ 29 FPS
[INFO] Loading detector model...
/home/videocon/work/FastMOT-master/fastmot/models/yolov4_crowdhuman.trt
[INFO] Loading feature extractor model...
config[feature_extractor]
{'model': 'OSNet025', 'batch_size': 16}
<class 'fastmot.models.reid.OSNet025'>
/home/videocon/work/FastMOT-master/fastmot/models/osnet_x0_25_msmt17.trt
[INFO] Building engine with batch size: 16
[INFO] This may take a while...
[TensorRT] ERROR: (Unnamed Layer* 486) [Shuffle]: at most one dimension may be inferred
[CRITICAL] Failed to parse the ONNX file
[ERROR] In node -1 (scaleHelper): UNSUPPORTED_NODE: Assertion failed: dims.nbDims == 4 || dims.nbDims == 5
Traceback (most recent call last):
File "app.py", line 109, in
main()
File "app.py", line 47, in main
draw=draw, verbose=args.verbose)
File "/home/videocon/work/FastMOT-master/fastmot/mot.py", line 57, in init
self.extractor = FeatureExtractor(config['feature_extractor'])
File "/home/videocon/work/FastMOT-master/fastmot/feature_extractor.py", line 19, in init
self.backend = InferenceBackend(self.model, self.batch_size)
File "/home/videocon/work/FastMOT-master/fastmot/utils/inference.py", line 46, in init
raise RuntimeError('Unable to load the engine file')
RuntimeError: Unable to load the engine file
(tensorflow) videocon@videocon-All-Series:~/work/FastMOT-master$

CMake Error

Installing FastMOT on a Ubuntu 18.04 and a Nvidia V100

scripts/install_tensorrt.sh
runs ok

When running
scripts/install_opencv.sh
I get the error

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppicom_LIBRARY (ADVANCED)

I already changed the variable ARCH_BIN=7.0

nvidia-smi
Mon Oct 26 02:45:02 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.32.00    Driver Version: 455.32.00    CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  On   | 00000000:00:04.0 Off |                    0 |
| N/A   33C    P0    23W / 300W |      0MiB / 16160MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Any help is appreciated.

Inference breaks with error

@GeekAlexis
Traceback (most recent call last):
File "app.py", line 109, in
main()
File "app.py", line 64, in main
mot.step(frame)
File "/usr/src/app/FastMOT/fastmot/mot.py", line 107, in step
self.tracker.update(self.frame_count, detections, embeddings)
File "/usr/src/app/FastMOT/fastmot/tracker.py", line 148, in update
cost = self._matching_cost(confirmed, detections, embeddings)
File "/usr/src/app/FastMOT/fastmot/tracker.py", line 246, in _matching_cost
motion_dist = self.kf.motion_distance(*track.state, detections.tlbr)
File "/usr/src/app/FastMOT/fastmot/kalman_filter.py", line 180, in motion_distance
return self._maha_distance(projected_mean, projected_cov, measurements)
File "/usr/local/lib/python3.6/dist-packages/numba/targets/linalg.py", line 887, in cho_impl
"Matrix is not positive definite.")
numpy.linalg.LinAlgError: Matrix is not positive definite.

uff-converter-tf package?

Where does the apt package uff-converter-tf come from? Which repository? scripts/install_tensorrt.sh tries to install it but apt cannot find it:

apt-cache search uff-converter-tf

returns no results. I am using Ubuntu 18.04. All other packages can be found ok.

Error with install_opencv.sh in Ubuntu 18

Got an error when running install_opencv.sh

> [  5%] Linking CXX static library ../lib/liblibprotobuf.a
> [  5%] Built target libprotobuf
> Makefile:181: recipe for target 'all' failed

Changing the opencv version to 4.1.2 at the .sh fixed the issue, maybe it's just me with the compatibility problem or something else going on.

installation problems

I really want to test your project as it seems quite accurate in tracking but i couldn't create a proper environment to test it.

Can you please provide versions numbers of the software your're using. To my understanding CUDA and etc are very unstable frameworks and you are using quite a lot of frameworks (ONXX, TensorRT....) that became possible points of failures.

My best chance was to use a nvidia tensort docker image but I finnaly have this error on ONXX and couldn't execute.

[TensorRT] ERROR: (Unnamed Layer* 486) [Shuffle]: at most one dimension may be inferred
[CRITICAL] Failed to parse the ONNX file
[ERROR] In node -1 (scaleHelper): UNSUPPORTED_NODE: Assertion failed: dims.nbDims == 4 || dims.nbDims == 5

I'm using this image

Maybe you can build a docker image :)

Thank you very much and kind regards, Juan Luis

Getting error TypeError: pybind11::init(): factory function returned nullptr

Hey @GeekAlexis
I am getting error:
[INFO] 960x540 stream @ 15 FPS
[INFO] Loading detector model...
[TensorRT] ERROR: CUDA initialization failure with error 3. Please check your CUDA installation: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
Traceback (most recent call last):
File "app.py", line 112, in
main()
File "app.py", line 50, in main
draw=draw, verbose=args.verbose)
File "/home/project/Desktop/FastMOT/fastmot/mot.py", line 50, in init
self.detector = YoloDetector(self.size, config['yolo_detector'])
File "/home/project/Desktop/FastMOT/fastmot/detector.py", line 181, in init
self.backend = InferenceBackend(self.model, self.batch_size)
File "/home/project/Desktop/FastMOT/fastmot/utils/inference.py", line 28, in init
self.runtime = trt.Runtime(InferenceBackend.TRT_LOGGER)
TypeError: pybind11::init(): factory function returned nullptr

I am using cuda 9.0, tensorrt version 7.2.2.3 , Ubuntu 16.04 , is there a way to handle this error

can it be faster than real time?

The way VideoIO is written, when reading a video from a file, the speed seems limited at the frame rate of the video file.

For example, when running a 30 FPS video like this, FastMOT runs at 31 FPS. When running the same video at 12 FPS video (this), FastMOT runs at 13 FPS. This is regardless of how high I set detector_frame_skip.

This SO question
seems to blame GStreamer, but this script runs much faster than the length of the video, so I don't think it's because of GStreamer vs ffmpeg:

#!/usr/bin/env python3

import cv2
import sys
import time

cap = cv2.VideoCapture(sys.argv[1])
start = time.time()

while True:
    image = cap.read()[1]
    if image is None:
        break

I think that the thread in VideoIO that extracts the frame waits according to the FPS of the file, as if it was a video stream, and just waits in the self.cond.wait() call. Any suggestion how to overcome this.

Custom model(yolov4) raises error

[INFO] 3840x1634 stream @ 25 FPS
[INFO] Loading detector model...
[INFO] Building engine with batch size: 1
[INFO] This may take a while...
[TensorRT] ERROR: (Unnamed Layer* 1330) [PluginV2IOExt]: PluginV2Layer must be V2DynamicExt when there are runtime input dimensions.
[TensorRT] ERROR: (Unnamed Layer* 1330) [PluginV2IOExt]: PluginV2Layer must be V2DynamicExt when there are runtime input dimensions.
[TensorRT] ERROR: Layer (Unnamed Layer* 1330) [PluginV2IOExt] failed validation
[TensorRT] ERROR: Network validation failed.
[CRITICAL] Failed to build engine
Traceback (most recent call last):
File "app.py", line 110, in
main()
File "app.py", line 47, in main
draw=draw, verbose=args.verbose)
File "/home/usr/FastMOT/fastmot/mot.py", line 50, in init
self.detector = YoloDetector(self.size, config['yolo_detector'])
File "/home/usr/FastMOT/fastmot/detector.py", line 181, in init
self.backend = InferenceBackend(self.model, self.batch_size)
File "/home/usr/FastMOT/fastmot/utils/inference.py", line 45, in init
raise RuntimeError('Unable to load the engine file')
RuntimeError: Unable to load the engine file

Xavier NX and Yolov4-Tiny

Hi,
Thanks for the great work. I have a few questions about the project.

1 - Are you using Yolov4 + DeepSort tracker? What is the speed in Jetson Nano?
2- Can we run it on Jetson Xavier NX as well with TenosrRT support?
3- Can we use any other yolov4 model trained for different classes and can track more than one class at the same time? i.e person and car?
4- Are you planning to update project to run with Yolov4-Tiny + DeepSort?

optical flow consume a lot of time.

When I run this repo in xavier Nx, I found use optical flow consumed a lot of time, is about from 30ms to 55ms, total fps is about 15.
And I set detector_frame_skip=1 in cfg/mot.json, but the optical flow speed is same but any change.
How will you get 22 fps, or would I ignore something?

Pytorch model

Hi,

Can I use this to run my pytorch model? I'm newbie. Thank you.

Acceleration/motion covariance?

In the Kalman filter, there is an acceleration covariance but I do not understand how it is used. Can you shed some light into why it is initialized like this? Maybe a reference? It seems that this is a textbook formula to determine the motion covariance but I can't find it. DeepSort seems to get the motion covariance in a different way.

Thank you,

empty output video

The output video when I run the command below is empty (0 bytes). Any idea why?

$ python3 app.py --input_uri MOT16-04-raw.mp4 --mot --output_uri /tmp/out.mp4
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (896) open OpenCV | GStreamer warning: unable to query duration of stream
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=0, duration=-1
[INFO] 1280x720 stream @ 30 FPS
[INFO] Loading detector model...
[INFO] Loading feature extractor model...
[INFO] Starting video capture...
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module appsrc0 reported: In
ternal data stream error.
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (1663) writeFrame OpenCV | GStreamer warning: Error pushing buffer to GStreamer pipeline
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (1663) writeFrame OpenCV | GStreamer warning: Error pushing buffer to GStreamer pipeline
[ WARN:0] global /home/sopsos/OpenCV/modules/videoio/src/cap_gstreamer.cpp (1663) writeFrame OpenCV | GStreamer warning: Error pushing buffer to GStreamer pipeline
[INFO] Found: person 1 at [277 350]
[INFO] Found: person 2 at [715 149]
[INFO] Found: person 3 at [380 161]
[INFO] Found: person 4 at [548 159]
[INFO] Found: person 5 at [932 459]
[INFO] Found: person 6 at [ 93 447]
[...]

I compiled OpenCV with the Gstreamer option as in https://github.com/GeekAlexis/FastMOT/blob/master/scripts/install_opencv.sh#L55 . Cmake shows:

[...]
--   Video I/O:
--     DC1394:                      YES (2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (57.107.100)
--       avformat:                  YES (57.83.100)
--       avutil:                    YES (55.78.100)
--       swscale:                   YES (4.8.100)
--       avresample:                YES (3.7.0)
--     GStreamer:                   YES (1.14.5)
--     v4l/v4l2:                    YES (linux/videodev2.h)
[...]

installation instructions for Windows

Unfortunately we only have limited linux machines at work, and they are being used for other things at the moment. We have plenty of Windows machines though. Are there any instructions for how to install this on Windows? I'm pretty sure I could figure it out, but some pointers might help me get there faster. Looking at install_jetson.sh, it seems like mostly installing python dependencies, installing LLVM and setting the path. Do you think I could just follow those same steps?

I saw in #35 that @xjsxujingsong had managed to install this on Windows. Perhaps she/he can share how they did it?

IDE

Hi ...,
Which IDE are you using?
Best regards,
PeterPham

Test is very slow in Jetson Xavier NX

@GeekAlexis
Hi, GeekAlexis, I test FastMOT in my Jetson Xavier NX, but it runing very slow and Average FPS: 2. The following is runing info:

zhihui@zhihui-desktop:~/project/FastMOT$ python3 app.py --input_uri test.mp4 --mot --gui --output_uri test_result.mp4
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (896) open OpenCV | GStreamer warning: unable to query duration of stream
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=0, duration=-1
[INFO] 1280x720 stream @ 30 FPS
[INFO] Loading detector model...
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
H264: Profile = 66, Level = 40 
[INFO] Building engine with batch size: 1
[INFO] This may take a while...
[INFO] Completed creating engine
[INFO] Loading feature extractor model...
[INFO] Building engine with batch size: 16
[INFO] This may take a while...
[INFO] Completed creating engine
Gtk-Message: 18:14:39.322: Failed to load module "canberra-gtk-module"
[INFO] Starting video capture...
/home/zhihui/.local/lib/python3.6/site-packages/numba/np/ufunc/parallel.py:363: NumbaWarning: The TBB threading layer requires TBB version 2019.5 or later i.e., TBB_INTERFACE_VERSION >= 11005. Found TBB_INTERFACE_VERSION = 9107. The TBB threading layer is disabled.
  warnings.warn(problem)
[INFO] Found: person 1 at [1106  494]
[INFO] Found: person 2 at [193 626]
[INFO] Found: person 3 at [997  76]
[INFO] Found: person 4 at [610 100]
[INFO] Found: person 5 at [558 219]
[INFO] Found: person 6 at [1225  183]
[INFO] Found: person 7 at [1099  668]
[INFO] Found: person 8 at [504 212]
[INFO] Found: person 9 at [611 338]
[INFO] Found: person 10 at [1121  136]
[INFO] Found: person 11 at [782  26]
[INFO] Found: person 12 at [893  16]
[INFO] Found: person 13 at [922  49]
[INFO] Found: person 14 at [212 248]
[INFO] Found: person 15 at [672  44]
[INFO] Found: person 16 at [464 690]
[INFO] Found: person 17 at [828   4]
[INFO] Found: person 18 at [239 212]
[INFO] Found: person 19 at [1199  485]
[INFO] Found: person 20 at [1162    7]
[INFO] Out: person 7 at [1089  720]
[INFO] Out: person 2 at [  8 701]
[INFO] Out: person 6 at [1280  153]
[INFO] Found: person 22 at [1216  331]
[INFO] Out: person 14 at [ -1 341]
[INFO] Lost: person 13 at [1048   15]
[INFO] Lost: person 1 at [1093  637]
[INFO] Found: person 23 at [1089   33]
[INFO] Out: person 19 at [1079  720]
[INFO] Found: person 24 at [ 30 441]
[INFO] Lost: person 17 at [902   0]
[INFO] Out: person 9 at [ 29 707]
[INFO] Found: person 25 at [973 689]
[INFO] Found: person 26 at [ 24 334]
[INFO] Re-identified: person 17 at [902   0]
[INFO] Out: person 3 at [1099   -1]
[INFO] Out: person 22 at [1042  720]
[INFO] Found: person 28 at [626 676]
[INFO] Lost: person 15 at [721  14]
[INFO] Out: person 23 at [1107    1]
[INFO] Found: person 29 at [ 38 463]
[INFO] Average FPS: 2
zhihui@zhihui-desktop:~/project/FastMOT$ ls

Can you tell me why it so slow?

Homography fails

Hi!

Whenever I try to test this project (which is very interesting by the way), it fails with:

Traceback (most recent call last):
  File "app.py", line 109, in <module>
    main()
  File "app.py", line 64, in main
    mot.step(frame)
  File "/home/moon/FastMOT/fastmot/mot.py", line 113, in step
    self.tracker.track(frame)
  File "/home/moon/FastMOT/fastmot/tracker.py", line 89, in track
    self.compute_flow(frame)
  File "/home/moon/FastMOT/fastmot/tracker.py", line 101, in compute_flow
    self.flow_bboxes, self.homography = self.flow.predict(frame, active_tracks)
  File "/home/moon/FastMOT/fastmot/flow.py", line 161, in predict
    confidence=self.ransac_conf)
cv2.error: OpenCV(3.4.12) /home/moon/opencv/modules/calib3d/src/fundam.cpp:379: error: (-28:Unknown error code -28) The input arrays should have at least 4 corresponding point sets to calculate Homography in function 'findHomography'

I'm running:

python3 app.py --input_uri /dev/video0 --mot --gui

Shapes of target mask and input frame are not matching

The issue is with mismatching shapes of target:(486, 218) and frame:(540, 960, 3). They should be same???
[INFO] 1280x720 stream @ 30 FPS
[INFO] Loading detector model...
[INFO] Loading feature extractor model...
[INFO] Starting video capture...
target:(486, 218), frame:(540, 960, 3)
Traceback (most recent call last):
File "app.py", line 109, in
main()
File "app.py", line 64, in main
mot.step(frame)
File "/home/ubuntu/code/FastMOT/fastmot/mot.py", line 111, in step
self.tracker.track(frame)
File "/home/ubuntu/code/FastMOT/fastmot/tracker.py", line 89, in track
self.compute_flow(frame)
File "/home/ubuntu/code/FastMOT/fastmot/tracker.py", line 101, in compute_flow
self.flow_bboxes, self.homography = self.flow.predict(frame, active_tracks)
File "/home/ubuntu/code/FastMOT/fastmot/flow.py", line 109, in predict
**self.target_feat_params)
cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-6amqbhlx/opencv/modules/imgproc/src/featureselect.cpp:365: error: (-215:Assertion failed) _mask.empty() || (_mask.type() == CV_8UC1 && _mask.sameSize(_image)) in function 'goodFeaturesToTrack'

the output value of yolov4 are all zero

hello, thanks for your repo. when I run app.py, yolov4 detector can not detect anything.
I print the output of yolov4 before postprocess, the output values are all zero
[[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
...
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]]

Thank you very much and kind regards

not a issue, but some naive questions of tensorrt with Batch inference for help?

I have tested this algorithm on my jetson TX2(11+fps, MAX_N), it is SO FAST!

but May I ask a question about how to use tensorrt model like OSNet to do inference with batches? and does it help with the speed when the object number is larger?

I transfer my custom Reid model by naively following nvidia trt python samples, but the example only show inference of batchsize=1, I know the code of tensorrt usage in this repo is so amazing, but it is a little bit difficult for a starter like me QAQ. So anyone can help me?

I do reference by sending a sample (1, 3, 256, 64) into do_inference(context, bindings, inputs, outputs, stream, batch_size=1) function, it works fine, but when I just send (2, 3, 256, 64) into do_inference(context, bindings, inputs, outputs, stream, batch_size=2) I get pycuda._driver.LogicError: cuMemcpyHtoDAsync failed: invalid argument

the model I generate from onnx to trt is by function:

def get_engine(onnx_file_path, engine_file_path=""):
    """Attempts to load a serialized engine if available, otherwise builds a new TensorRT engine and saves it."""
    def build_engine():
        """Takes an ONNX file and creates a TensorRT engine to run inference with"""
        with trt.Builder(TRT_LOGGER) as builder, builder.create_network(common.EXPLICIT_BATCH) as network, trt.OnnxParser(network, TRT_LOGGER) as parser:
            builder.max_workspace_size = 1 << 28 # 256MiB
            builder.max_batch_size = 1                             #   should I change this ?
            # Parse model file
            if not os.path.exists(onnx_file_path):
                print('ONNX file {} not found, please run yolov3_to_onnx.py first to generate it.'.format(onnx_file_path))
                exit(0)
            print('Loading ONNX file from path {}...'.format(onnx_file_path))
            with open(onnx_file_path, 'rb') as model:
                print('Beginning ONNX file parsing')
                if not parser.parse(model.read()):
                    print ('ERROR: Failed to parse the ONNX file.')
                    for error in range(parser.num_errors):
                        print (parser.get_error(error))
                    return None
            # The actual yolov3.onnx is generated with batch size 64. Reshape input to batch size 1
            network.get_input(0).shape = [1, 3, 256, 64]
            print('Completed parsing of ONNX file')
            print('Building an engine from file {}; this may take a while...'.format(onnx_file_path))
            engine = builder.build_cuda_engine(network)
            print("Completed creating Engine")
            with open(engine_file_path, "wb") as f:
                f.write(engine.serialize())
            return engine

    if os.path.exists(engine_file_path):
        # If a serialized engine exists, use it instead of building an engine.
        print("Reading engine from file {}".format(engine_file_path))
        with open(engine_file_path, "rb") as f, trt.Runtime(TRT_LOGGER) as runtime:
            return runtime.deserialize_cuda_engine(f.read())
    else:
        return build_engine()

the do_reference function in trt samples is like following:

def do_inference(context, bindings, inputs, outputs, stream, batch_size=1):
    # Transfer input data to the GPU.
    [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs]
    # Run inference.
    context.execute_async(batch_size=batch_size, bindings=bindings, stream_handle=stream.handle)
    # Transfer predictions back from the GPU.
    [cuda.memcpy_dtoh_async(out.host, out.device, stream) for out in outputs]
    # Synchronize the stream
    stream.synchronize()
    # Return only the host outputs.
    return [out.host for out in outputs]

High CPU usage on Jetson Nano

Hi, I've tested your project on a Jetson Nano, and, while I am very happy with the detections and the speed, I found that the CPU was used way too much, capping the speed of all the other programs I run on the Nano. I've tried "turning off" the feature extractor (raising the detector_frame_skip to 99999), switching between YOLO / SSD and enabling sync to gstreamer in videoio.py. The only "solution" I found is using cpulimit, but I really want to avoid using it. I'm pretty sure I followed the installation step correctly, here's my numba install:

System info:

Time Stamp
2021-02-04 09:34:31.190870

Hardware Information
Machine : aarch64
CPU Name : cortex-a57
Number of accessible CPU cores : 4
Listed accessible CPUs cores : 0-3
CFS restrictions : None
CPU Features :
crc crypto fp-armv8 neon

OS Information
Platform : Linux-4.9.140-tegra-aarch64-with-Ubuntu-18.04-bionic
Release : 4.9.140-tegra
System Name : Linux
Version : #1 SMP PREEMPT Tue Oct 27 21:02:37 PDT 2020
OS specific info : Ubuntu18.04bionic
glibc info : glibc 2.25

Python Information
Python Compiler : GCC 8.4.0
Python Implementation : CPython
Python Version : 3.6.9
Python Locale : it_IT UTF-8

LLVM information
LLVM version : 7.0.1

CUDA Information
Found 1 CUDA devices
id 0 b'NVIDIA Tegra X1' [SUPPORTED]
compute capability: 5.3
pci device id: 0
pci bus id: 0
Summary:
1/1 devices are supported
CUDA driver version : 10020
CUDA libraries:
Finding cublas from System
named libcublas.so
trying to open library... ok
Finding cusparse from System
named libcusparse.so.10.3.1.89
trying to open library... ok
Finding cufft from System
named libcufft.so.10.1.2.89
trying to open library... ok
Finding curand from System
named libcurand.so.10.1.2.89
trying to open library... ok
Finding nvvm from System
named libnvvm.so.3.3.0
trying to open library... ok
Finding libdevice from System
searching for compute_20... ok
searching for compute_30... ok
searching for compute_35... ok
searching for compute_50... ok

ROC Information
ROC available : False
Error initialising ROC due to : No ROC toolchains found.
No HSA Agents found, encountered exception when searching:
Error at driver init:
NUMBA_HSA_DRIVER /opt/rocm/lib/libhsa-runtime64.so is not a valid file path. Note it must be a filepath of the .so/.dll/.dylib or the driver:

SVML Information
SVML state, config.USING_SVML : False
SVML library found and loaded : False
llvmlite using SVML patched LLVM : False
SVML operational : False

Threading Layer Information
TBB Threading layer available : True
OpenMP Threading layer available : False
+--> Disabled due to : Unknown import problem.
Workqueue Threading layer available : True

Numba Environment Variable Information
None set.

Conda Information
Conda not present/not working.
Error was [Errno 2] No such file or directory: 'conda': 'conda'

And the usage:
image

types of tracks?

Could you describe in plain English the differences between a confirmed, unconfirmed, active and lost track? Your code is very clear but it would help me understand the association steps better.

Thank you,

[Question] Running on Coral Accelerator

Hello @GeekAlexis . Thank you for the great work. The YOLOv4 model runs very nicely on the Jetson Nano, but I was looking into converting it to TFLite to run it on a Coral accelerator. Do you have any suggestions as to where to start with that? I figured most changes would come in inference.py, but are there any other pitfalls that I should look for?

camera motion estimation failed

when I run python3 app.py --input_uri /dev/video0 --mot,I encounter this problem ’[WARNING] Camera motion estimation failed‘,do you know how to solve it?

How to train ReID model and convert to .onnx ?

Hi @GeekAlexis ,
For the customs classes (person and car), training a Yolo model is very simple, but can you explain how to train ReID model? Can you please provide the link for the exact project you used to train the current DeepSort ReID model? Can we use the same project for training model for person car?
I swapped the feature extractor in Deep SORT for a better ReID model, OSNet.. Do you mean you are using OSNet in place of DeepSort? Just a little bit confusion the OSNet is another tracker or some kind of implementation of DeepSort?

My goal is to track person and car. I know how to train Yolo model but the ReID step is not clear. Please explain when you have some spare time. Thanks.

Error when running install_jetson.sh Jetson TX2

I got an error trying to install cython-bbox, it seems that it depends on cython to be installed and when running the command sudo pip3 install cython numpy pycuda cython-bbox pip tries to install cython-bbox first so it fails if you've never installed cython before. I suggest changing the script to

sudo pip3 install cython
sudo pip3 install numpy pycuda cython-bbox

At least this errors occurs on a fresh installation of the Jetpack 4.4.1 on the Jetson TX2

Cannot install CUDA 10.2

Steps to reproduce:

  1. Install fresh Ubuntu 18.04
  2. Clone the FastMOT repo
  3. Execute line by line of script https://github.com/GeekAlexis/FastMOT/blob/master/scripts/install_tensorrt.sh
  4. Right after line 27, it definitely installs cuda-10-2. See:
aptitude search cuda
p   boinc-client-nvidia-cuda                                                                  - metapackage for CUDA-savvy BOINC client and manager                                                 
p   caffe-cuda                                                                                - Fast, open framework for Deep Learning (Meta)                                                       
p   caffe-tools-cuda                                                                          - Tools for fast, open framework for Deep Learning (CUDA)                                             
i   cuda                                                                                      - CUDA meta-package                                                                                   
p   cuda-10-0                                                                                 - CUDA 10.0 meta-package                                                                              
p   cuda-10-1                                                                                 - CUDA 10.1 meta-package                                                                              
i A cuda-10-2                                                                                 - CUDA 10.2 meta-package                                                                              
p   cuda-11-0                                                                                 - CUDA 11.0 meta-package                                                                              
p   cuda-11-1                                                                                 - CUDA 11.1 meta-package      

But when running nvidia-smi, it shows:

NVIDIA-SMI 455.32.00    Driver Version: 455.32.00    CUDA Version: 11.1

I have a Tesla T4

How to fill the 'ANCHORS' in yolo.py?

Hello , thank you to open your code!
i want to use it detect the airplane which is used our own datasets, and need to change the anchors in darknet(YOLOv4) cfg file
so if I use your code ,how to fill the ANCHORS in yolo.py? Could you give a example to achieve it ?
because i don't understand that You need to mask out the anchors for each yolo layer using the indices in mask. For tiny and YOLOv3, the anchors are usually flipped. this sentence in README..md

for a instance , my anchors are 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401
and how to fill the 'ANCHORS' in yolo.py?
Thank you very much!

smooth feature vs. window of last appearances?

FastMOT seems to use a exponentially decaying "smooth feature", using a weight of 0.9, here. Instead DeepSORT uses a gallery/window of the last 100 associated appearance descriptors of each track, and the distance corresponds to the minimum across all of them (Equation 3).

Any reason for this? Did it speed it up enough without dropping accuracy significantly? It seems more intuitive to me to remember a few last descriptors since the appearance of moving objects can change but still all of them might be representative of the object (say for example an object rotating).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.