スキップしてメイン コンテンツに移動

Panoptic driving Perception (YOLOPv2)

https://github.com/CAIC-AD/YOLOPv2

https://arxiv.org/abs/2208.11434
YOLOPv2: Better, Faster, Stronger for Panoptic Driving Perception

 

0. Rosbag to mp4

sip2@sip2-2021:~/catkin_od/src/object_detection/scripts/YOLOPv2$ cd ~
sip2@sip2-2021:~$ cd sample_code/
PythonRobotics/ rosbag2video/   
sip2@sip2-2021:~/sample_code/rosbag2video$ ./rosbag2video.py --topic /camera/color/image_raw /media/sip2/SIP2022/2022-09-16-iam-5.bag
############# UNCOMPRESSED IMAGE ######################
/camera/color/image_raw  with datatype: sensor_msgs/Image

finished653 fps=297 q=28.0 size=   27392kB time=00:05:43.64 bitrate= 653.0kbits/s speed=11.8x    
frame= 8798 fps=294 q=-1.0 Lsize=   28093kB time=00:05:51.80 bitrate= 654.2kbits/s speed=11.7x  
 

 

1. YOLOPv2

sip2@sip2-2021:~$ source ~/anaconda3/etc/profile.d/conda.sh
sip2@sip2-2021:~$ conda info --e
# conda environments:
#
base                  *  /home/sip2/anaconda3
py38-test                /home/sip2/anaconda3/envs/py38-test
py38-torch1-12-1         /home/sip2/anaconda3/envs/py38-torch1-12-1
py38-torch1-12-1-gpu-od     /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od

sip2@sip2-2021:~$ conda create -n py38-torch1-12-1-gpu-yolopv2 --clone py38-torch1-12-1
Source:      /home/sip2/anaconda3/envs/py38-torch1-12-1
Destination: /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-yolopv2
Packages: 65
Files: 0
Preparing transaction: done
Verifying transaction: |
SafetyError: The package for pytorch located at /home/sip2/anaconda3/pkgs/pytorch-1.12.1-py3.8_cuda11.6_cudnn8.3.2_0
appears to be corrupted. The path 'lib/python3.8/site-packages/torch/nn/modules/upsampling.py'
has an incorrect size.
  reported size: 11056 bytes
  actual size: 11005 bytes


done
Executing transaction: - By downloading and using the CUDA Toolkit conda packages, you accept the terms and conditions of the CUDA End User License Agreement (EULA): https://docs.nvidia.com/cuda/eula/index.html

done
#
# To activate this environment, use
#
#     $ conda activate py38-torch1-12-1-gpu-yolopv2
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(py38-torch1-12-1-gpu-yolopv2) sip2@sip2-2021:~/catkin_od/src/object_detection/scripts$ git clone https://github.com/CAIC-AD/YOLOPv2.git
Cloning into 'YOLOPv2'...
remote: Enumerating objects: 162, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 162 (delta 34), reused 6 (delta 5), pack-reused 113
Receiving objects: 100% (162/162), 57.29 MiB | 8.22 MiB/s, done.
Resolving deltas: 100% (60/60), done.

(py38-torch1-12-1-gpu-yolopv2) sip2@sip2-2021:~/catkin_od/src/object_detection/scripts$ cd YOLOPv2/

 

(py38-torch1-12-1-gpu-yolopv2) sip2@sip2-2021:~/catkin_od/src/object_detection/scripts/YOLOPv2$ pip install -r requirements.txt

# Usage: pip install -r requirements.txt

# Base ----------------------------------------
matplotlib>=3.2.2
numpy>=1.18.5
opencv-python>=4.1.1
Pillow>=7.1.2
PyYAML>=5.3.1
requests>=2.23.0
scipy>=1.4.1
torch>=1.7.0
torchvision>=0.8.1,!=0.13.0
tqdm>=4.41.0
protobuf<4.21.3

# Logging -------------------------------------
tensorboard>=2.4.1
# wandb

# Plotting ------------------------------------
pandas>=1.1.4
seaborn>=0.11.0

# Export --------------------------------------
# coremltools>=4.1 # CoreML export
# onnx>=1.9.0 # ONNX export
# onnx-simplifier>=0.3.6 # ONNX simplifier
# scikit-learn==0.19.2 # CoreML quantization
# tensorflow>=2.4.1 # TFLite export
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev # OpenVINO export

# Extras --------------------------------------
ipython # interactive notebook
psutil # system utilization
thop # FLOPs computation
# albumentations>=1.0.3
# pycocotools>=2.0 # COCO mAP
# roboflow


(py38-torch1-12-1-gpu-yolopv2) sip2@sip2-2021:~/catkin_od/src/object_detection/scripts/YOLOPv2$ python demo.py  --source data/example.jpg


Namespace(agnostic_nms=False, classes=None, conf_thres=0.3, device='0', exist_ok=False, img_size=640, iou_thres=0.45, name='exp', nosave=False, project='runs/detect', save_conf=False, save_txt=False, source='data/example.jpg', weights='data/weights/yolopv2.pt')
/home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-yolopv2/lib/python3.8/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1659484683044/work/aten/src/ATen/native/TensorShape.cpp:2894.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
384x640 Done. (1.498s)
 The image with the result is saved in: runs/detect/exp/example.jpg
inf : (1.4985s/frame)   nms : (0.0059s/frame)
Done. (1.566s)






コメント

このブログの人気の投稿

[참고] ROS kinetic에서 WebCam 사용하기 (Ubuntu 16.04)

Reference: 1. https://github.com/bosch-ros-pkg/usb_cam/issues/53  2. http://zumashi.blogspot.jp/2016/12/ros-kinetic-usb-cam.html  3. http://cafe.naver.com/openrt/5963 위의 사이트들을 참고하여 ROS Kinetic에서 Logitech WebCam C270의 동작을 확인했습니다. $ cd ~/catkin_ws/src $ git clone https://github.com/bosch-ros-pkg/usb-cam.git $ cd .. $ catkin_make WebCam test $ roscore $ rosrun usb_cam usb_cam_node $ rosrun image_view image_view image:=/usb_cam/image_raw $ rosrun rviz rviz 1) By display type>rviz>image 2) Image topic: /usb_cam/image_raw --> 왼쪽 하단과 같이 WebCam이 잘 동작하는 것을 확인했습니다.

[vscode] TImeout waiting for debugger connection

이제까지 잘 동작하던 비주얼 스튜디오 코드가 위와 같은 에러 메세지를 내면서 갑자기 디버깅이 안되서 인터넷을 검색한 결과.. vscode의 User Setting에서 검색창에 python.terminal.activateEnvironment을 입력하여 true로 설정되어 있는 값을 false로 변환하면 된다. 

日常の話

今年の夏は本当に暑かったですね。それで、我らもなるべく室内で活動しました。図書館で絵本を読んでいる長男さん。 カラオケ大会〜〜 漫画を読んでいた長女 長男はおもちゃで遊んでました。 魚べいで外食 橋コンテストで出品する作品を作る次女 長男が大好きなマインクラフトレゴ。官舎の壁は長男の落書きで大変な状態です。 お父さん、お母さんが作って下さった美味しい料理 お父さんのハヤシライスは美味しい! 頑張って運動している長男 親切に教えてくれた先生たち、ありがとうございました。 JAXA来年までメイン建物が運営しません!ご参考までに〜〜 長女と長男、図書室の中で〜〜