Multispectral Object Detection with Yolov5

Overview

Multispectral-Object-Detection

Intro

Official Code for Cross-Modality Fusion Transformer for Multispectral Object Detection.

Multispectral Object Detection with Transformer and Yolov5

Citation

If you use this repo for your research, please cite our paper:

@article{fang2021cross,
  title={Cross-Modality Fusion Transformer for Multispectral Object Detection},
  author={Fang Qingyun and Han Dapeng and Wang Zhaokui},
  journal={arXiv preprint arXiv:2111.00273},
  year={2021}
}

Installation

Python>=3.6.0 is required with all requirements.txt installed including PyTorch>=1.7 (The same as yolov5 https://github.com/ultralytics/yolov5 ).

Clone the repo

git clone https://github.com/DocF/multispectral-object-detection

Install requirements

$ cd  multispectral-object-detection
$ pip install -r requirements.txt

Dataset

-[FLIR] download A new aligned version.

-[LLVIP] download

-[VEDAI] download

Run

Download the pretrained weights

yolov5 weights:

CFT weights:

Add the some file

create runs/train, runs/test and runs/detect three files for save the results.

Change the data cfg

some example in data/multispectral/

Train Test and Detect

train: python train.py

test: python test.py

detect: python detect_twostream.py

Results

Dataset CFT mAP50 mAP75 mAP
FLIR 73.0 32.0 37.4
FLIR ✔️ 77.7 (Δ4.7) 34.8 (Δ2.8) 40.0 (Δ2.6)
LLVIP 95.8 71.4 62.3
LLVIP ✔️ 97.5 (Δ1.7) 72.9 (Δ1.5) 63.6 (Δ1.3)
VEDAI 79.7 47.7 46.8
VEDAI ✔️ 85.3 (Δ5.6) 65.9(Δ18.2) 56.0 (Δ9.2)
Comments
  • 关于训练文件缺失的问题

    关于训练文件缺失的问题

    Traceback (most recent call last): File "/home/fhl/src/rgbt-det/multispectral-object-detection/train.py", line 1028, in train_rgb_ir(hyp, opt, device, tb_writer) File "/home/fhl/src/rgbt-det/multispectral-object-detection/train.py", line 519, in train_rgb_ir model = Model(opt.cfg or ckpt['model'].yaml, ch=6, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/home/fhl/src/rgbt-det/multispectral-object-detection/models/yolo_test.py", line 188, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/home/fhl/src/rgbt-det/multispectral-object-detection/models/yolo_test.py", line 529, in parse_model elif m is CMAFF: NameError: name 'CMAFF' is not defined

    在common.py文件中发现CMAFF未定义,请问是什么原因导致的?

    opened by 116508 4
  • Could you provide the checkpoint on FLIR dataset?

    Could you provide the checkpoint on FLIR dataset?

    Thank you for your nice work.

    I train the model with the option as below :

    parser.add_argument('--cfg', type=str, default='./models/transformer/yolov5l_fusion_transformerx3_FLIR_aligned.yaml', help='model.yaml path')
    

    Then, I can't reproduce the results on FLIR dataset in the paper.

    The results of training process

    image

    The result of best checkpoint

    image

    Could you provide the checkpoint on FLIR dataset?

    Also, i got difference baseline result when i train the add-fusion model.

    image image

    opened by socome 3
  • 您好,能向您要一份您的yolov5 format的LLVIP数据集吗?

    您好,能向您要一份您的yolov5 format的LLVIP数据集吗?

    # train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/] train_rgb: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/rgb/align_train.txt # 128 images val_rgb: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/rgb/align_validation.txt # 128 images train_ir: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/ir/align_train.txt # 128 images val_ir: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/ir/align_validation.txt # 128 images 对于这种方式的目录结构和.txt的内容不是很清楚,所以想像你要一份yolov5 format的llvip数据,非常感谢!

    opened by Hiram1026 3
  • about cls loss is zero

    about cls loss is zero

    How do you do? May I ask why CLS is always 0 when I train Epoch gpu_mem box obj cls total labels img_size 3/199 7.64G 0.04769 0.02945 0 0.07714 7 640: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6013/6013 [24:45<00:00, 4.05it/s] Class Images Labels P R [email protected] [email protected] [email protected]:.95: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 866/866 [01:19<00:00, 10.83it/s] all 3463 7931 0.821 0.803 0.802 0.289 0.371

    opened by wlc-git 3
  • I can't reproduce the result of paper with provided checkpoint.

    I can't reproduce the result of paper with provided checkpoint.

    I can't reproduce the result of paper with provided checkpoint. There is a small difference. Could you give me the label files of FLIR datsets..? Also, Do you have the mAP result of single modality on each of the topics..? and Could you provide it ..?

    Thank you so much, looking forward to your reply!

    paper image

    result with provided checkpoint

    image

    opened by socome 1
  • 我在你发布的模型yolov5l_transformerx3_llvip_s1024_bs32_e200上跑detect没有效果呢?

    我在你发布的模型yolov5l_transformerx3_llvip_s1024_bs32_e200上跑detect没有效果呢?

    python .\detect_twostream.py --weights=./pre_models/yolov5l_transformerx3_llvip_s1024_bs32_e200 --source1=C:/HMZ/work/project/datasets/LLVIP/infrared/test --source2=C:/HMZ/work/project/datasets/LLVIP/visible/test --img-size=1024 --device=0

    260505_ir

    opened by Hiram1026 1
  • about yolov5s_fusion_add_vedai.yaml

    about yolov5s_fusion_add_vedai.yaml

    According to the image in your paper, the YAML file should be two streams of input RGB image and IR image respectively. Why the input of the second stream [-4, 1, Focus, [64, 3]],-4 means from layer 6 instead of IR images? Why not for example [-10,1, Focus, [64, 3]] (of course this will not work)

    opened by mzzjuve 1
  • 关于在LLVIP数据集上的复现结果

    关于在LLVIP数据集上的复现结果

    作者你好, 如这里所述,LLVIP数据集自发表以后被更新了一次,更新后的LLVIP数据集的行人检测精度也提高了,即: image 从图中可以看出,更新后的LLVIP仅在infrared模态上的检测结果(0.67)就优于您论文中的结果(0.636): image 考虑到LLVIP被更新过一次,于是我将您的代码在新的LLVIP上重新训练了一次,batch_size=8x4gpus, image_size=1024. cfg is here, hyp is here. 我训练的结果为0.656,远低于LLVIP中仅使用infrared的结果。 image 为了实验的公平性,我已确认您的代码和LLVIP开源的代码都是YOLOv5 (version5.0)。请看LLVIP作者的回复,以及您之前的回复.

    以上实验结果令我非常困惑,请问您是否能提供在新的LLVIP数据集上的CFT的mAP呢?这对后来者与您的方法做公平对比非常重要

    期待您的回复

    opened by XueZ-phd 1
  • Issue in path

    Issue in path

    Namespace(augment=False, batch_size=64, conf_thres=0.001, data='/home/delll/mark1/multispectral-object-detection/data/multispectral/FLIR_aligned.yaml', device='', exist_ok=False, img_size=640, iou_thres=0.5, name='exp', project='runs/test', save_conf=True, save_hybrid=False, save_json=False, save_txt=True, single_cls=False, task='val', verbose=False, weights='/home/delll/mark1/multispectral-object-detection/best.pt') /home/delll/mark1/multispectral-object-detection/data/multispectral/FLIR_aligned.yaml YOLOv5 🚀 387dc3e torch 1.13.0+cu117 CPU

    Fusing layers... Model Summary: 1015 layers, 206209480 parameters, 0 gradients val Traceback (most recent call last): File "/home/delll/mark1/multispectral-object-detection/utils/datasets.py", line 875, in init raise Exception(f'{prefix}{path_rgb} does not exist') Exception: val: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/rgb/align_validation.txt does not exist

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "test.py", line 339, in opt=opt File "test.py", line 94, in test prefix=colorstr(f'{task}: '))[0] File "/home/delll/mark1/multispectral-object-detection/utils/datasets.py", line 236, in create_dataloader_rgb_ir prefix=prefix) File "/home/delll/mark1/multispectral-object-detection/utils/datasets.py", line 899, in init raise Exception(f'{prefix}Error loading data from {path_rgb,path_ir}: {e}\nSee {help_url}') Exception: val: Error loading data from ('/home/fqy/Data/FLIR_ADAS_1_3/align/yolo/rgb/align_validation.txt', '/home/fqy/Data/FLIR_ADAS_1_3/align/yolo/ir/align_validation.txt'): val: /home/fqy/Data/FLIR_ADAS_1_3/align/yolo/rgb/align_validation.txt does not exist See https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data

    opened by nineRishav 1
  • 'SPPF'

    'SPPF'

    image #Can't get attribute 'SPPF' on <module 'models.common' from 'G:\pythonfile\multispectral-object-detection-main\multispectral-object-detection-main\models\common.py'> How to solve this problem?

    opened by 1phil1 1
Owner
Richard Fang
Richard Fang
🍅🍅🍅YOLOv5-Lite: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 1.7M (int8) and 3.3M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size is 320×320~

YOLOv5-Lite:lighter, faster and easier to deploy Perform a series of ablation experiments on yolov5 to make it lighter (smaller Flops, lower memory, a

pogg 1.5k Jan 5, 2023
Yolov5-lite - Minimal PyTorch implementation of YOLOv5

Yolov5-Lite: Minimal YOLOv5 + Deep Sort Overview This repo is a shortened versio

Kadir Nar 57 Nov 28, 2022
YOLOv5 🚀 is a family of object detection architectures and models pretrained on the COCO dataset

YOLOv5 ?? is a family of object detection architectures and models pretrained on the COCO dataset, and represents Ultralytics open-source research int

阿才 73 Dec 16, 2022
YOLOv5 + ROS2 object detection package

YOLOv5-ROS YOLOv5 + ROS2 object detection package This program changes the input of detect.py (ultralytics/yolov5) to sensor_msgs/Image of ROS2. Requi

Ar-Ray 23 Dec 19, 2022
Multiple Object Tracking with Yolov5!

Tracking with yolov5 This implementation is for who need to tracking multi-object only with detector. You can easily track mult-object with your well

null 9 Nov 8, 2022
Playing around with FastAPI and streamlit to create a YoloV5 object detector

FastAPI-Streamlit-based-YoloV5-detector Playing around with FastAPI and streamlit to create a YoloV5 object detector It turns out that a User Interfac

null 2 Jan 20, 2022
Hybrid CenterNet - Hybrid-supervised object detection / Weakly semi-supervised object detection

Hybrid-Supervised Object Detection System Object detection system trained by hybrid-supervision/weakly semi-supervision (HSOD/WSSOD): This project is

null 5 Dec 10, 2022
Yolo object detection - Yolo object detection with python

How to run download required files make build_image make download Docker versio

null 3 Jan 26, 2022
Drone detection using YOLOv5

This drone detection system uses YOLOv5 which is a family of object detection architectures and we have trained the model on Drone Dataset. Overview I

Tushar Sarkar 27 Dec 20, 2022
joint detection and semantic segmentation, based on ultralytics/yolov5,

Multi YOLO V5——Detection and Semantic Segmentation Overeview This is my undergraduate graduation project which based on ultralytics YOLO V5 tag v5.0.

null 477 Jan 6, 2023
YOLOv5 detection interface - PyQt5 implementation

所有代码已上传,直接clone后,运行yolo_win.py即可开启界面。 2021/9/29:加入置信度选择 界面是在ultralytics的yolov5基础上建立的,界面使用pyqt5实现,内容较简单,娱乐而已。 功能: 模型选择 本地文件选择(视频图片均可) 开关摄像头

null 487 Dec 27, 2022
A Python training and inference implementation of Yolov5 helmet detection in Jetson Xavier nx and Jetson nano

yolov5-helmet-detection-python A Python implementation of Yolov5 to detect head or helmet in the wild in Jetson Xavier nx and Jetson nano. In Jetson X

null 12 Dec 5, 2022
Yolov5+SlowFast: Realtime Action Detection Based on PytorchVideo

Yolov5+SlowFast: Realtime Action Detection A realtime action detection frame work based on PytorchVideo. Here are some details about our modification:

WuFan 181 Dec 30, 2022
Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera.

Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera. This project prepares training and testing data for various deep learning projects such as 6D object pose estimation projects singleshotpose, as well as object detection and instance segmentation projects.

null 305 Dec 16, 2022
Official PyTorch implementation of Joint Object Detection and Multi-Object Tracking with Graph Neural Networks

This is the official PyTorch implementation of our paper: "Joint Object Detection and Multi-Object Tracking with Graph Neural Networks". Our project website and video demos are here.

Richard Wang 443 Dec 6, 2022
CLOCs: Camera-LiDAR Object Candidates Fusion for 3D Object Detection

CLOCs is a novel Camera-LiDAR Object Candidates fusion network. It provides a low-complexity multi-modal fusion framework that improves the performance of single-modality detectors. CLOCs operates on the combined output candidates of any 3D and any 2D detector, and is trained to produce more accurate 3D and 2D detection results.

Su Pang 254 Dec 16, 2022
Object Detection and Multi-Object Tracking

Object Detection and Multi-Object Tracking

Bobby Chen 1.6k Jan 4, 2023
Object tracking and object detection is applied to track golf puts in real time and display stats/games.

Putting_Game Object tracking and object detection is applied to track golf puts in real time and display stats/games. Works best with the Perfect Prac

Max 1 Dec 29, 2021