# 交通标志识别 **Repository Path**: ahao3512/traffic-sign-recognition ## Basic Information - **Project Name**: 交通标志识别 - **Description**: YOLOv5+streamlit+GTSRB - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2023-04-24 - **Last Updated**: 2023-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 交通标志识别 #### 介绍 YOLOv5+streamlit+GTSRB #### 注意事项 此库中包含yolov5和streamlit,streamlit video使用时请将mp4文件放至data文件夹下,此外本库不包含YOLOv5训练模型权重,需自行下载 #### 所需环境 YOLOv5 base ---------------------------------------- 1. matplotlib>=3.2.2 2. numpy>=1.18.5 3. opencv-python>=4.1.2 4. Pillow 5. PyYAML>=5.3.1 6. scipy>=1.4.1 7. torch>=1.7.0 8. torchvision>=0.8.1 9. tqdm>=4.41.0 logging ------------------------------------- 1. tensorboard>=2.4.1 2. wandb plotting ------------------------------------ 1. seaborn>=0.11.0 2. pandas export -------------------------------------- 1. coremltools>=4.1 2. onnx>=1.8.1 streamlit 1. torch==1.7.1+cpu 2. torchvision==0.8.2+cpu 3. opencv-python==4.5.1.48 4. Pillow==8.0.1 5. pandas==1.2.1 6. streamlit==0.78.0 7. streamlit-webrtc==0.7.2 8. matplotlib==3.3.3 9. tqdm==4.56.0 10. PyYAML==5.3.1 11. seaborn==0.11.1 #### 文件下载 1. GTSRB数据集 官方地址:https://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset 百度网盘链接:https://pan.baidu.com/s/11nuut730ajKiKYkLqnKtzQ 提取码:u3mc 2. pytorch模型 百度网盘链接:https://pan.baidu.com/s/1if1mbCD_e9x_SPZ4qD74Wg 提取码: yawj #### 使用步骤 1. 在detect.py文件里面,在如下部分修改weights和source使其对应训练好的模型和待检测路径。 ``` parser.add_argument('--weights', nargs='+', type=str, default=r'模型路径(例如C:\Users\hp\Desktop\GTSRB20.pt'), help='model.pt path(s)') parser.add_argument('--source', type=str, default=r'待检测图片路径(例如C:\Users\hp\Desktop\images', help='source')) # file/folder, 0 for webcam parser.add_argument('--img-size', type=int, default=320, help='inference size (pixels)') ``` 2. 运行detect.py文件,对待检测文件夹里面的图片进行预测处理,最终在runs/detect/exp文件夹下生成对应的图片或视频。 3. cd进入streamlit文件夹下,输入命令`streamlit run app.py`,效果如下 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0618/221459_cf1839f2_5305892.png "QQ图片20210618221440.png")