# SmartCarriageScan **Repository Path**: taj5/SmartCarriageScan ## Basic Information - **Project Name**: SmartCarriageScan - **Description**: 车厢列检 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-19 - **Last Updated**: 2025-04-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 元宝山装车火车视觉检测项目 ## 项目结构 ```bash . ├── scs/ # 车厢列检 │ ├── __init__.py │ ├── main.py # 主应用入口 │ ├── config.py # 配置管理 │ ├── dependencies.py # 依赖注入 │ ├── processing.py # 核心处理逻辑 │ ├── schemas.py # 数据模型定义 │ └── utils/ │ ├── __init__.py │ ├── cache.py # 缓存管理 │ └── helpers.py # 工具函数 ├── test/ # 测试用例 | ├── 00001.jpg # 车厢列检测试用例 | ├── 1431652.jpg # 车号识别测试用例 | └──... ├── images/ # 结果图片保存目录 ├── logs/ # 日志目录 ├── models/ # 模型目录 │ ├── region_detection.pt # 车厢列检定位模型 │ ├── bolt_cls.pt # 门闩分类模型 │ ├── ocr_model # 车号识别模型 │ └── ... ├── start.sh # 服务启动脚本 ├── stop.sh # 服务停止脚本 ├── README.md └── requirements.txt ``` ## 启动服务 ```bash cd SmartCarriageScan ./start.sh ``` ## 接口说明 ### 车厢列检 ```bash # 上传文件 curl -X POST "http://localhost:9527/analyze" \ -H "Content-Type: multipart/form-data" \ -F "file=@test/00001.jpg" \ -F "threshold=0.9" # 可选参数,默认0.9, 0-1之间,值越大,异常检出率越高 # 传递路径 curl -X POST "http://localhost:9527/analyze" \ -H "Content-Type: multipart/form-data" \ -F "local_file=/home/mt/wuhao-dev/SmartCarriageScan/test/00001.jpg" \ -F "threshold=0.9" { "image_name": "00187.jpg", "image_md5": "462c811c4b0fc190a498634c7abaac78", "receiving_time": "2025-02-21 09:37:51", "processing_time": 1.3444762229919434, "image_saved_path": "images/2025-02-21/00187.jpg_result.jpg", "detection_results": [ { "label": "bolt", "bbox": [ 1338.16650390625, 729.670166015625, 1410.9595947265625, 827.3561401367188 ], "det_score": 0.6140782833099365, "cls_score": 0.9998453855514526 } ] } ``` ### 车号识别 ```bash # 上传文件 curl -X POST "http://localhost:9527/box_ocr" \ -H "Content-Type: multipart/form-data" \ -F "file=@test/1431652.jpg" # 传递服务器文件路径 curl -X POST "http://localhost:9527/carriage_ocr" \ -H "Content-Type: multipart/form-data" \ -F "local_file=/home/mt/wuhao-dev/SmartCarriageScan/test/ocr_1431652.jpg" # 传递服务器文件路径 curl -X POST "http://localhost:9527/box_ocr" \ -H "Content-Type: multipart/form-data" \ -F "local_file=/home/mt/wuhao-dev/SmartCarriageScan/test/10.jpg" # 车型车号识别返回结构 { "image_name":"1431652.jpg", "image_md5":"", "receiving_time":"2025-02-21 23:53:12", "processing_time":4.541287899017334, "image_saved_path":"", "answer":"C62BK@1431652", "carriage_type":"C62BK", "carriage_id":"1431652" } # 集装箱箱号识别返回结构 { "image_name":"10.jpg", "image_md5":"967a43f56eeffbd76c5a60acfe2e7d8b", "receiving_time":"2025-04-07 14:48:10", "processing_time":3.232102632522583, "image_saved_path":"ocr_results/2025-04-07/967a43f56eeffbd76c5a60acfe2e7d8b.jpg", "answer":"CP0C174365|CICU318777", "carriage_type":"NA", "carriage_id":"NA" } ```