網頁

2024年9月26日 星期四

MMTracking 學習紀錄

參考 https://mmtracking.readthedocs.io/en/latest/index.html
參考 https://github.com/open-mmlab/mmtracking

$ git clone https://github.com/open-mmlab/mmtracking.git

$ docker run --gpus all -it --rm nvcr.io/nvidia/pytorch:21.05-py3
$ docker run --gpus all -it --name MMTracking nvcr.io/nvidia/pytorch:21.05-py3
$ docker start MMTracking
$ docker attach MMTracking
# <ctrl+p><ctrl+q>
$ docker attach MMTracking
$ docker stop MMTracking
$ docker rm MMTracking

$ echo $DISPLAY
$ export DISPLAY=:0
$ xhost +
$ docker run --gpus all -it --name MMTracking --shm-size=8G \
  --net=host -e DISPLAY=$DISPLAY -e XAUTHORITY=/tmp/xauth \
  -e QT_X11_NO_MITSHM=1 \
  -v /tmp/.X11-unix/:/tmp/.X11-unix \
  -v ~/.Xauthority:/tmp/xauth \
  -v /etc/localtime:/etc/localtime \
  -v /mnt/Data/MMTracking/mmtracking:/workspace/mmtracking \
  nvcr.io/nvidia/pytorch:21.05-py3

# pip install git+https://github.com/votchallenge/toolkit.git
# nvidia-smi
CUDA Version: 12.2
# pip list
opencv-python                    4.10.0.84
torch                            1.9.0a0+2ecb2c7

# pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu122/torch1.9.0/index.html
#### 出現下列錯誤
####    cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
####AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)
#### 解決
# pip install opencv-python==4.5.1.48

# pip install mmdet==2.28.2
# pip install mmengine==0.10.4
# pip list
mmcv-full                        1.7.2
mmdet                            2.28.2
mmengine                         0.10.4
pillow                           10.4.0
# cd /workspace/mmtracking/
# pip install -r requirements/build.txt
# pip install -v -e .
# pip install git+https://github.com/JonathonLuiten/TrackEval.git
# pip install git+https://github.com/lvis-dataset/lvis-api.git
# pip install git+https://github.com/TAO-Dataset/tao.git

# python demo/demo_mot_vis.py configs/mot/deepsort/deepsort_faster-rcnn_fpn_4e_mot17-private-half.py \
  --input demo/demo.mp4 --output mot.mp4 --show
#### 出現下列錯誤
####    from .cv2 import *
####ImportError: libGL.so.1: cannot open shared object file: No such file or directory
#### 解決
# apt-get update
# apt-get install libgl1
#### 出現下列錯誤
####    NumpyArray = npt.NDArray[Any]
####AttributeError: module 'numpy.typing' has no attribute 'NDArray'
#### 解決
# pip install Pillow==9.5.0
#### 出現下列錯誤
#### Could not load the Qt platform plugin "xcb" in "/opt/conda/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
####This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
#### 查詢錯誤所在
# export QT_DEBUG_PLUGINS=1
####Cannot load library /opt/conda/lib/python3.8/site-packages/cv2/qt/plugins/platforms/libqxcb.so: (libSM.so.6: cannot open shared object file: No such file or directory)
#### 解決
# apt-get install -y libsm6 libxext6 libxrender-dev
# pip install opencv-contrib-python==4.5.1.48

# wget https://download.openmmlab.com/mmtracking/mot/ocsort/mot_dataset/ocsort_yolox_x_crowdhuman_mot17-private-half_20220813_101618-fe150582.pth
# python demo/demo_mot_vis.py configs/mot/ocsort/ocsort_yolox_x_crowdhuman_mot17-private-half.py \
  --checkpoint ocsort_yolox_x_crowdhuman_mot17-private-half_20220813_101618-fe150582.pth \
  --input demo/demo.mp4 --output mot.mp4 --show

# wget https://download.openmmlab.com/mmtracking/vid/selsa/selsa_faster_rcnn_r101_dc5_1x_imagenetvid/selsa_faster_rcnn_r101_dc5_1x_imagenetvid_20201218_172724-aa961bcc.pth
# python demo/demo_vid.py configs/vid/selsa/selsa_faster_rcnn_r101_dc5_1x_imagenetvid.py \
  --checkpoint selsa_faster_rcnn_r101_dc5_1x_imagenetvid_20201218_172724-aa961bcc.pth \
  --input demo/demo.mp4 --show

# python demo/demo_sot.py configs/sot/siamese_rpn/siamese_rpn_r50_20e_lasot.py \
  --input demo/demo.mp4 --output sot.mp4 --show
#### 用滑鼠框出要追蹤的物件,按空白鍵

沒有留言:

張貼留言