PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.79k stars 2.89k forks source link

[BUG]在使用paddleDetection时候,使用VOC数据集导出的模型的infer_info的label_list与正常一样,但是每次使用COCO数据集,指点数据集的位置和分类的种类数目,但是每次导出模型的infer_info的label_list都是80个,且模型无效,不能预测出测试集的目标。 #5448

Closed Craw-B closed 2 years ago

Craw-B commented 2 years ago

在我的coco数据集的格式如下 metric: COCO num_classes: 4

TrainDataset: !COCODataSet image_dir: images anno_path: annotations/train.json dataset_dir: dataset/roadsign_coco data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']

EvalDataset: !COCODataSet image_dir: images anno_path: annotations/valid.json dataset_dir: dataset/roadsign_coco

TestDataset: !ImageFolder anno_path: annnotations/valid.json 但是导出模型就先80个,而且无法进行预测和部署 如下 mode: fluid draw_threshold: 0.5 metric: COCO use_dynamic_shape: false arch: SSD min_subgraph_size: 60 Preprocess:

ghostxsl commented 2 years ago

https://github.com/PaddlePaddle/PaddleDetection/blob/develop/configs/datasets/coco_detection.yml#L19 更换指定anno_path内的json文件里的标注类别名称

Craw-B commented 2 years ago

你的意思时写成拒绝路径对吗,按照这个coco_detection的例子他不是绝对路经啊。我不太懂你的意思,我如果要用自己的coco数据应该怎么办,能给我一个具体的指导意见吗,卡了好几天了

ghostxsl commented 2 years ago

如果你没有指定anno_file,框架会默认加载coco的类别标签,参考:https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/engine/trainer.py#L545

ghostxsl commented 2 years ago

anno_file得写成绝对路径,要么你就直接在代码里改也行,参考:https://github.com/PaddlePaddle/PaddleDetection/blob/b615336fe3a9ff740fdb1b889be7bc865b6d20fa/ppdet/data/source/category.py#L29

paddle-bot-old[bot] commented 2 years ago

Since this issue has not been updated for more than three months, it will be closed, if it is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于该问题超过三个月未更新,将会被关闭,若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。