JoyeZLearning / DiffDet4SAR

DiffDet4SAR: Diffusion-based Aircraft Target Detection Network for SAR Images(GRSL 2024)
Other
27 stars 3 forks source link

Can you provide the code for converting your dataset to COCO format? #2

Closed 2000YWQ closed 1 month ago

2000YWQ commented 5 months ago

I am having some problems converting SAR-AIRcraft 1.0 dataset format to COCO format.Thank you very much.

JoyeZLearning commented 5 months ago

You can share your problems about converting format to coco and I am willing to help you. As for the codes, there are many resources available online to help you to address your problems.

2000YWQ commented 5 months ago

The format of the processed data is the same for the coco dataset and the pascal_voc dataset in detectron2/data/datasets/coco.py and /detectron2/data/datasets/pascal_voc.py,so I've created a soft connection to VOC2007.my yaml is: DATASETS: TRAIN: ("voc_2007_train",) TEST: ("voc_2007_val",) and I've modified detectron2/data/datasets/pascal_voc.py: CLASS_NAMES = ( "A220", "A320/321", "A330", "ARJ21", "Boeing737", "Boeing787", "other" ) Finally It automatically generates the voc_2007_val_coco_format.json file. But my result is bad image

there is my log: `[04/10 06:18:32] detectron2 INFO: Full config saved to ./output/config.yaml [04/10 06:18:36] d2.checkpoint.detection_checkpoint INFO: [DetectionCheckpointer] Loading from detectron2://ImageNetPretrained/torchvision/R-50.pkl ... [04/10 06:18:36] fvcore.common.checkpoint INFO: [Checkpointer] Loading from /root/.torch/iopath_cache/detectron2/ImageNetPretrained/torchvision/R-50.pkl ... [04/10 06:18:36] fvcore.common.checkpoint INFO: Reading a file from 'torchvision' [04/10 06:18:36] d2.checkpoint.c2_model_loading INFO: Following weights matched with submodule backbone.bottom_up - Total num: 53 [04/10 06:18:36] fvcore.common.checkpoint WARNING: Some model parameters or buffers are not found in the checkpoint: alphas_cumprod alphas_cumprod_prev backbone.fpn_lateral2.{bias, weight} backbone.fpn_lateral3.{bias, weight} backbone.fpn_lateral4.{bias, weight} backbone.fpn_lateral5.{bias, weight} backbone.fpn_output2.{bias, weight} backbone.fpn_output3.{bias, weight} backbone.fpn_output4.{bias, weight} backbone.fpn_output5.{bias, weight} betas diff_conv5.weight head.head_series.0.bboxes_delta.{bias, weight} head.head_series.0.block_time_mlp.1.{bias, weight} head.head_series.0.class_logits.{bias, weight} head.head_series.0.cls_module.0.weight head.head_series.0.cls_module.1.{bias, weight} head.head_series.0.inst_interact.dynamic_layer.{bias, weight} head.head_series.0.inst_interact.norm1.{bias, weight} head.head_series.0.inst_interact.norm2.{bias, weight} head.head_series.0.inst_interact.norm3.{bias, weight} head.head_series.0.inst_interact.out_layer.{bias, weight} head.head_series.0.linear1.{bias, weight} head.head_series.0.linear2.{bias, weight} head.head_series.0.norm1.{bias, weight} head.head_series.0.norm2.{bias, weight} head.head_series.0.norm3.{bias, weight} head.head_series.0.reg_module.0.weight head.head_series.0.reg_module.1.{bias, weight} head.head_series.0.reg_module.3.weight head.head_series.0.reg_module.4.{bias, weight} head.head_series.0.reg_module.6.weight head.head_series.0.reg_module.7.{bias, weight} head.head_series.0.self_attn.out_proj.{bias, weight} head.head_series.0.self_attn.{in_proj_bias, in_proj_weight} head.head_series.1.bboxes_delta.{bias, weight} head.head_series.1.block_time_mlp.1.{bias, weight} head.head_series.1.class_logits.{bias, weight} head.head_series.1.cls_module.0.weight head.head_series.1.cls_module.1.{bias, weight} head.head_series.1.inst_interact.dynamic_layer.{bias, weight} head.head_series.1.inst_interact.norm1.{bias, weight} head.head_series.1.inst_interact.norm2.{bias, weight} head.head_series.1.inst_interact.norm3.{bias, weight} head.head_series.1.inst_interact.out_layer.{bias, weight} head.head_series.1.linear1.{bias, weight} head.head_series.1.linear2.{bias, weight} head.head_series.1.norm1.{bias, weight} head.head_series.1.norm2.{bias, weight} head.head_series.1.norm3.{bias, weight} head.head_series.1.reg_module.0.weight head.head_series.1.reg_module.1.{bias, weight} head.head_series.1.reg_module.3.weight head.head_series.1.reg_module.4.{bias, weight} head.head_series.1.reg_module.6.weight head.head_series.1.reg_module.7.{bias, weight} head.head_series.1.self_attn.out_proj.{bias, weight} head.head_series.1.self_attn.{in_proj_bias, in_proj_weight} head.head_series.2.bboxes_delta.{bias, weight} head.head_series.2.block_time_mlp.1.{bias, weight} head.head_series.2.class_logits.{bias, weight} head.head_series.2.cls_module.0.weight head.head_series.2.cls_module.1.{bias, weight} head.head_series.2.inst_interact.dynamic_layer.{bias, weight} head.head_series.2.inst_interact.norm1.{bias, weight} head.head_series.2.inst_interact.norm2.{bias, weight} head.head_series.2.inst_interact.norm3.{bias, weight} head.head_series.2.inst_interact.out_layer.{bias, weight} head.head_series.2.linear1.{bias, weight} head.head_series.2.linear2.{bias, weight} head.head_series.2.norm1.{bias, weight} head.head_series.2.norm2.{bias, weight} head.head_series.2.norm3.{bias, weight} head.head_series.2.reg_module.0.weight head.head_series.2.reg_module.1.{bias, weight} head.head_series.2.reg_module.3.weight head.head_series.2.reg_module.4.{bias, weight} head.head_series.2.reg_module.6.weight head.head_series.2.reg_module.7.{bias, weight} head.head_series.2.self_attn.out_proj.{bias, weight} head.head_series.2.self_attn.{in_proj_bias, in_proj_weight} head.head_series.3.bboxes_delta.{bias, weight} head.head_series.3.block_time_mlp.1.{bias, weight} head.head_series.3.class_logits.{bias, weight} head.head_series.3.cls_module.0.weight head.head_series.3.cls_module.1.{bias, weight} head.head_series.3.inst_interact.dynamic_layer.{bias, weight} head.head_series.3.inst_interact.norm1.{bias, weight} head.head_series.3.inst_interact.norm2.{bias, weight} head.head_series.3.inst_interact.norm3.{bias, weight} head.head_series.3.inst_interact.out_layer.{bias, weight} head.head_series.3.linear1.{bias, weight} head.head_series.3.linear2.{bias, weight} head.head_series.3.norm1.{bias, weight} head.head_series.3.norm2.{bias, weight} head.head_series.3.norm3.{bias, weight} head.head_series.3.reg_module.0.weight head.head_series.3.reg_module.1.{bias, weight} head.head_series.3.reg_module.3.weight head.head_series.3.reg_module.4.{bias, weight} head.head_series.3.reg_module.6.weight head.head_series.3.reg_module.7.{bias, weight} head.head_series.3.self_attn.out_proj.{bias, weight} head.head_series.3.self_attn.{in_proj_bias, in_proj_weight} head.head_series.4.bboxes_delta.{bias, weight} head.head_series.4.block_time_mlp.1.{bias, weight} head.head_series.4.class_logits.{bias, weight} head.head_series.4.cls_module.0.weight head.head_series.4.cls_module.1.{bias, weight} head.head_series.4.inst_interact.dynamic_layer.{bias, weight} head.head_series.4.inst_interact.norm1.{bias, weight} head.head_series.4.inst_interact.norm2.{bias, weight} head.head_series.4.inst_interact.norm3.{bias, weight} head.head_series.4.inst_interact.out_layer.{bias, weight} head.head_series.4.linear1.{bias, weight} head.head_series.4.linear2.{bias, weight} head.head_series.4.norm1.{bias, weight} head.head_series.4.norm2.{bias, weight} head.head_series.4.norm3.{bias, weight} head.head_series.4.reg_module.0.weight head.head_series.4.reg_module.1.{bias, weight} head.head_series.4.reg_module.3.weight head.head_series.4.reg_module.4.{bias, weight} head.head_series.4.reg_module.6.weight head.head_series.4.reg_module.7.{bias, weight} head.head_series.4.self_attn.out_proj.{bias, weight} head.head_series.4.self_attn.{in_proj_bias, in_proj_weight} head.head_series.5.bboxes_delta.{bias, weight} head.head_series.5.block_time_mlp.1.{bias, weight} head.head_series.5.class_logits.{bias, weight} head.head_series.5.cls_module.0.weight head.head_series.5.cls_module.1.{bias, weight} head.head_series.5.inst_interact.dynamic_layer.{bias, weight} head.head_series.5.inst_interact.norm1.{bias, weight} head.head_series.5.inst_interact.norm2.{bias, weight} head.head_series.5.inst_interact.norm3.{bias, weight} head.head_series.5.inst_interact.out_layer.{bias, weight} head.head_series.5.linear1.{bias, weight} head.head_series.5.linear2.{bias, weight} head.head_series.5.norm1.{bias, weight} head.head_series.5.norm2.{bias, weight} head.head_series.5.norm3.{bias, weight} head.head_series.5.reg_module.0.weight head.head_series.5.reg_module.1.{bias, weight} head.head_series.5.reg_module.3.weight head.head_series.5.reg_module.4.{bias, weight} head.head_series.5.reg_module.6.weight head.head_series.5.reg_module.7.{bias, weight} head.head_series.5.self_attn.out_proj.{bias, weight} head.head_series.5.self_attn.{in_proj_bias, in_proj_weight} head.time_mlp.1.{bias, weight} head.time_mlp.3.{bias, weight} log_one_minus_alphas_cumprod posterior_log_variance_clipped posterior_mean_coef1 posterior_mean_coef2 posterior_variance sqrt_alphas_cumprod sqrt_one_minus_alphas_cumprod sqrt_recip_alphas_cumprod sqrt_recipm1_alphas_cumprod [04/10 06:18:36] fvcore.common.checkpoint WARNING: The checkpoint state_dict contains keys that are not used by the model: stem.fc.{bias, weight} [04/10 06:18:36] d2.data.build INFO: Distribution of instances among all 7 categories:  category #instances category #instances category #instances
A220 247 A320/321 82 A330 27
ARJ21 378 Boeing737 252 Boeing787 261
other 715
total 1962 
[04/10 06:18:36] d2.data.dataset_mapper INFO: [DatasetMapper] Augmentations used in inference: [ResizeShortestEdge(short_edge_length=(800, 800), max_size=1800, sample_style='choice')] [04/10 06:18:36] d2.data.common INFO: Serializing the dataset using: <class 'detectron2.data.common._TorchSerializedList'> [04/10 06:18:36] d2.data.common INFO: Serializing 442 elements to byte tensors and concatenating them all ... [04/10 06:18:36] d2.data.common INFO: Serialized dataset takes 0.23 MiB [04/10 06:18:36] d2.evaluation.coco_evaluation INFO: Fast COCO eval is not built. Falling back to official COCO eval. [04/10 06:18:36] d2.evaluation.coco_evaluation WARNING: COCO Evaluator instantiated using config, this is deprecated behavior. Please pass in explicit arguments instead. [04/10 06:18:36] d2.evaluation.coco_evaluation INFO: Trying to convert 'voc_2007_val' to COCO format ... [04/10 06:18:36] d2.data.datasets.coco WARNING: Using previously cached COCO format annotations at './output/inference/voc_2007_val_coco_format.json'. You need to clear the cache file if your dataset has been modified. [04/10 06:18:36] d2.evaluation.evaluator INFO: Start inference on 442 batches [04/10 06:18:37] d2.evaluation.evaluator INFO: Inference done 11/442. Dataloading: 0.0007 s/iter. Inference: 0.0795 s/iter. Eval: 0.0003 s/iter. Total: 0.0805 s/iter. ETA=0:00:34 [04/10 06:18:42] d2.evaluation.evaluator INFO: Inference done 73/442. Dataloading: 0.0011 s/iter. Inference: 0.0792 s/iter. Eval: 0.0003 s/iter. Total: 0.0807 s/iter. ETA=0:00:29 [04/10 06:18:47] d2.evaluation.evaluator INFO: Inference done 133/442. Dataloading: 0.0011 s/iter. Inference: 0.0804 s/iter. Eval: 0.0003 s/iter. Total: 0.0820 s/iter. ETA=0:00:25 [04/10 06:18:53] d2.evaluation.evaluator INFO: Inference done 196/442. Dataloading: 0.0012 s/iter. Inference: 0.0799 s/iter. Eval: 0.0003 s/iter. Total: 0.0815 s/iter. ETA=0:00:20 [04/10 06:18:58] d2.evaluation.evaluator INFO: Inference done 258/442. Dataloading: 0.0012 s/iter. Inference: 0.0798 s/iter. Eval: 0.0003 s/iter. Total: 0.0814 s/iter. ETA=0:00:14 [04/10 06:19:03] d2.evaluation.evaluator INFO: Inference done 321/442. Dataloading: 0.0012 s/iter. Inference: 0.0796 s/iter. Eval: 0.0003 s/iter. Total: 0.0812 s/iter. ETA=0:00:09 [04/10 06:19:08] d2.evaluation.evaluator INFO: Inference done 384/442. Dataloading: 0.0012 s/iter. Inference: 0.0795 s/iter. Eval: 0.0003 s/iter. Total: 0.0811 s/iter. ETA=0:00:04 [04/10 06:19:12] d2.evaluation.evaluator INFO: Total inference time: 0:00:35.438219 (0.081094 s / iter per device, on 1 devices) [04/10 06:19:12] d2.evaluation.evaluator INFO: Total inference pure compute time: 0:00:34 (0.079390 s / iter per device, on 1 devices) [04/10 06:19:13] d2.evaluation.coco_evaluation INFO: Preparing results for COCO format ... [04/10 06:19:13] d2.evaluation.coco_evaluation INFO: Saving results to ./output/inference/coco_eval_instances_results.json [04/10 06:19:13] d2.evaluation.coco_evaluation INFO: Evaluating predictions with official COCO API... [04/10 06:19:17] d2.evaluation.coco_evaluation INFO: Evaluation results for bbox: AP AP50 AP75 APs APm APl
0.000 0.000 0.000 nan 0.000 0.000
[04/10 06:19:17] d2.evaluation.coco_evaluation INFO: Some metrics cannot be computed and is shown as NaN. [04/10 06:19:17] d2.evaluation.coco_evaluation INFO: Per-category bbox AP: category AP category AP category AP
A220 0.000 A320/321 0.000 A330 0.000
ARJ21 0.000 Boeing737 0.000 Boeing787 0.000
other 0.000

[04/10 06:19:17] d2.engine.defaults INFO: Evaluation results for voc_2007_val in csv format: [04/10 06:19:17] d2.evaluation.testing INFO: copypaste: Task: bbox [04/10 06:19:17] d2.evaluation.testing INFO: copypaste: AP,AP50,AP75,APs,APm,APl [04/10 06:19:17] d2.evaluation.testing INFO: copypaste: 0.0000,0.0000,0.0000,nan,0.0000,0.0000 [04/10 06:22:43] detectron2 INFO: Rank of current process: 0. World size: 1 [04/10 06:22:44] detectron2 INFO: Environment info:


sys.platform linux Python 3.9.19 (main, Mar 21 2024, 17:11:28) [GCC 11.2.0] numpy 1.26.4 detectron2 0.6 @/workspace/DiffDet4SAR/detectron2 detectron2._C not built correctly: No module named 'detectron2._C' Compiler ($CXX) c++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 DETECTRON2_ENV_MODULE PyTorch 1.11.0 @/opt/conda/envs/diffusion/lib/python3.9/site-packages/torch PyTorch debug build False torch._C._GLIBCXX_USE_CXX11_ABI False GPU available Yes GPU 0 NVIDIA TITAN Xp (arch=6.1) Driver version 470.182.03 CUDA_HOME None - invalid! Pillow 10.2.0 torchvision 0.12.0 @/opt/conda/envs/diffusion/lib/python3.9/site-packages/torchvision torchvision arch flags /opt/conda/envs/diffusion/lib/python3.9/site-packages/torchvision/_C.so fvcore 0.1.6 iopath 0.1.9 cv2 4.9.0


PyTorch built with:

[04/10 06:22:44] detectron2 INFO: Command line arguments: Namespace(config_file='configs/diffdet.voc.res50.yaml', resume=False, eval_only=True, num_gpus=1, num_machines=1, machine_rank=0, dist_url='tcp://127.0.0.1:49152', opts=[]) [04/10 06:22:44] detectron2 INFO: Contents of args.config_file=configs/diffdet.voc.res50.yaml: BASE: "Base-DiffusionDet.yaml" MODEL: WEIGHTS: "detectron2://ImageNetPretrained/torchvision/R-50.pkl" RESNETS: DEPTH: 50 STRIDE_IN_1X1: False DiffusionDet: NUM_PROPOSALS: 500 NUM_CLASSES: 7 DATASETS: TRAIN: ("voc_2007_train",) TEST: ("voc_2007_val",) SOLVER: STEPS: (350000, 420000) MAX_ITER: 450000 INPUT: CROP: ENABLED: True FORMAT: "RGB"

[04/10 06:22:44] detectron2 INFO: Running with full config: CUDNN_BENCHMARK: false DATALOADER: ASPECT_RATIO_GROUPING: true FILTER_EMPTY_ANNOTATIONS: false NUM_WORKERS: 4 REPEAT_THRESHOLD: 0.0 SAMPLER_TRAIN: TrainingSampler DATASETS: PRECOMPUTED_PROPOSAL_TOPK_TEST: 1000 PRECOMPUTED_PROPOSAL_TOPK_TRAIN: 2000 PROPOSAL_FILES_TEST: [] PROPOSAL_FILES_TRAIN: [] TEST:

[04/10 06:22:44] detectron2 INFO: Full config saved to ./output/config.yaml [04/10 06:22:48] d2.checkpoint.detection_checkpoint INFO: [DetectionCheckpointer] Loading from detectron2://ImageNetPretrained/torchvision/R-50.pkl ... [04/10 06:22:48] fvcore.common.checkpoint INFO: [Checkpointer] Loading from /root/.torch/iopath_cache/detectron2/ImageNetPretrained/torchvision/R-50.pkl ... [04/10 06:22:48] fvcore.common.checkpoint INFO: Reading a file from 'torchvision' [04/10 06:22:48] d2.checkpoint.c2_model_loading INFO: Following weights matched with submodule backbone.bottom_up - Total num: 53 [04/10 06:22:48] fvcore.common.checkpoint WARNING: Some model parameters or buffers are not found in the checkpoint: alphas_cumprod alphas_cumprod_prev backbone.fpn_lateral2.{bias, weight} backbone.fpn_lateral3.{bias, weight} backbone.fpn_lateral4.{bias, weight} backbone.fpn_lateral5.{bias, weight} backbone.fpn_output2.{bias, weight} backbone.fpn_output3.{bias, weight} backbone.fpn_output4.{bias, weight} backbone.fpn_output5.{bias, weight} betas diff_conv5.weight head.head_series.0.bboxes_delta.{bias, weight} head.head_series.0.block_time_mlp.1.{bias, weight} head.head_series.0.class_logits.{bias, weight} head.head_series.0.cls_module.0.weight head.head_series.0.cls_module.1.{bias, weight} head.head_series.0.inst_interact.dynamic_layer.{bias, weight} head.head_series.0.inst_interact.norm1.{bias, weight} head.head_series.0.inst_interact.norm2.{bias, weight} head.head_series.0.inst_interact.norm3.{bias, weight} head.head_series.0.inst_interact.out_layer.{bias, weight} head.head_series.0.linear1.{bias, weight} head.head_series.0.linear2.{bias, weight} head.head_series.0.norm1.{bias, weight} head.head_series.0.norm2.{bias, weight} head.head_series.0.norm3.{bias, weight} head.head_series.0.reg_module.0.weight head.head_series.0.reg_module.1.{bias, weight} head.head_series.0.reg_module.3.weight head.head_series.0.reg_module.4.{bias, weight} head.head_series.0.reg_module.6.weight head.head_series.0.reg_module.7.{bias, weight} head.head_series.0.self_attn.out_proj.{bias, weight} head.head_series.0.self_attn.{in_proj_bias, in_proj_weight} head.head_series.1.bboxes_delta.{bias, weight} head.head_series.1.block_time_mlp.1.{bias, weight} head.head_series.1.class_logits.{bias, weight} head.head_series.1.cls_module.0.weight head.head_series.1.cls_module.1.{bias, weight} head.head_series.1.inst_interact.dynamic_layer.{bias, weight} head.head_series.1.inst_interact.norm1.{bias, weight} head.head_series.1.inst_interact.norm2.{bias, weight} head.head_series.1.inst_interact.norm3.{bias, weight} head.head_series.1.inst_interact.out_layer.{bias, weight} head.head_series.1.linear1.{bias, weight} head.head_series.1.linear2.{bias, weight} head.head_series.1.norm1.{bias, weight} head.head_series.1.norm2.{bias, weight} head.head_series.1.norm3.{bias, weight} head.head_series.1.reg_module.0.weight head.head_series.1.reg_module.1.{bias, weight} head.head_series.1.reg_module.3.weight head.head_series.1.reg_module.4.{bias, weight} head.head_series.1.reg_module.6.weight head.head_series.1.reg_module.7.{bias, weight} head.head_series.1.self_attn.out_proj.{bias, weight} head.head_series.1.self_attn.{in_proj_bias, in_proj_weight} head.head_series.2.bboxes_delta.{bias, weight} head.head_series.2.block_time_mlp.1.{bias, weight} head.head_series.2.class_logits.{bias, weight} head.head_series.2.cls_module.0.weight head.head_series.2.cls_module.1.{bias, weight} head.head_series.2.inst_interact.dynamic_layer.{bias, weight} head.head_series.2.inst_interact.norm1.{bias, weight} head.head_series.2.inst_interact.norm2.{bias, weight} head.head_series.2.inst_interact.norm3.{bias, weight} head.head_series.2.inst_interact.out_layer.{bias, weight} head.head_series.2.linear1.{bias, weight} head.head_series.2.linear2.{bias, weight} head.head_series.2.norm1.{bias, weight} head.head_series.2.norm2.{bias, weight} head.head_series.2.norm3.{bias, weight} head.head_series.2.reg_module.0.weight head.head_series.2.reg_module.1.{bias, weight} head.head_series.2.reg_module.3.weight head.head_series.2.reg_module.4.{bias, weight} head.head_series.2.reg_module.6.weight head.head_series.2.reg_module.7.{bias, weight} head.head_series.2.self_attn.out_proj.{bias, weight} head.head_series.2.self_attn.{in_proj_bias, in_proj_weight} head.head_series.3.bboxes_delta.{bias, weight} head.head_series.3.block_time_mlp.1.{bias, weight} head.head_series.3.class_logits.{bias, weight} head.head_series.3.cls_module.0.weight head.head_series.3.cls_module.1.{bias, weight} head.head_series.3.inst_interact.dynamic_layer.{bias, weight} head.head_series.3.inst_interact.norm1.{bias, weight} head.head_series.3.inst_interact.norm2.{bias, weight} head.head_series.3.inst_interact.norm3.{bias, weight} head.head_series.3.inst_interact.out_layer.{bias, weight} head.head_series.3.linear1.{bias, weight} head.head_series.3.linear2.{bias, weight} head.head_series.3.norm1.{bias, weight} head.head_series.3.norm2.{bias, weight} head.head_series.3.norm3.{bias, weight} head.head_series.3.reg_module.0.weight head.head_series.3.reg_module.1.{bias, weight} head.head_series.3.reg_module.3.weight head.head_series.3.reg_module.4.{bias, weight} head.head_series.3.reg_module.6.weight head.head_series.3.reg_module.7.{bias, weight} head.head_series.3.self_attn.out_proj.{bias, weight} head.head_series.3.self_attn.{in_proj_bias, in_proj_weight} head.head_series.4.bboxes_delta.{bias, weight} head.head_series.4.block_time_mlp.1.{bias, weight} head.head_series.4.class_logits.{bias, weight} head.head_series.4.cls_module.0.weight head.head_series.4.cls_module.1.{bias, weight} head.head_series.4.inst_interact.dynamic_layer.{bias, weight} head.head_series.4.inst_interact.norm1.{bias, weight} head.head_series.4.inst_interact.norm2.{bias, weight} head.head_series.4.inst_interact.norm3.{bias, weight} head.head_series.4.inst_interact.out_layer.{bias, weight} head.head_series.4.linear1.{bias, weight} head.head_series.4.linear2.{bias, weight} head.head_series.4.norm1.{bias, weight} head.head_series.4.norm2.{bias, weight} head.head_series.4.norm3.{bias, weight} head.head_series.4.reg_module.0.weight head.head_series.4.reg_module.1.{bias, weight} head.head_series.4.reg_module.3.weight head.head_series.4.reg_module.4.{bias, weight} head.head_series.4.reg_module.6.weight head.head_series.4.reg_module.7.{bias, weight} head.head_series.4.self_attn.out_proj.{bias, weight} head.head_series.4.self_attn.{in_proj_bias, in_proj_weight} head.head_series.5.bboxes_delta.{bias, weight} head.head_series.5.block_time_mlp.1.{bias, weight} head.head_series.5.class_logits.{bias, weight} head.head_series.5.cls_module.0.weight head.head_series.5.cls_module.1.{bias, weight} head.head_series.5.inst_interact.dynamic_layer.{bias, weight} head.head_series.5.inst_interact.norm1.{bias, weight} head.head_series.5.inst_interact.norm2.{bias, weight} head.head_series.5.inst_interact.norm3.{bias, weight} head.head_series.5.inst_interact.out_layer.{bias, weight} head.head_series.5.linear1.{bias, weight} head.head_series.5.linear2.{bias, weight} head.head_series.5.norm1.{bias, weight} head.head_series.5.norm2.{bias, weight} head.head_series.5.norm3.{bias, weight} head.head_series.5.reg_module.0.weight head.head_series.5.reg_module.1.{bias, weight} head.head_series.5.reg_module.3.weight head.head_series.5.reg_module.4.{bias, weight} head.head_series.5.reg_module.6.weight head.head_series.5.reg_module.7.{bias, weight} head.head_series.5.self_attn.out_proj.{bias, weight} head.head_series.5.self_attn.{in_proj_bias, in_proj_weight} head.time_mlp.1.{bias, weight} head.time_mlp.3.{bias, weight} log_one_minus_alphas_cumprod posterior_log_variance_clipped posterior_mean_coef1 posterior_mean_coef2 posterior_variance sqrt_alphas_cumprod sqrt_one_minus_alphas_cumprod sqrt_recip_alphas_cumprod sqrt_recipm1_alphas_cumprod [04/10 06:22:48] fvcore.common.checkpoint WARNING: The checkpoint state_dict contains keys that are not used by the model: stem.fc.{bias, weight} [04/10 06:22:48] d2.data.build INFO: Distribution of instances among all 7 categories:  category #instances category #instances category #instances
A220 247 A320/321 82 A330 27
ARJ21 378 Boeing737 252 Boeing787 261
other 715
total 1962 
[04/10 06:22:48] d2.data.dataset_mapper INFO: [DatasetMapper] Augmentations used in inference: [ResizeShortestEdge(short_edge_length=(800, 800), max_size=1800, sample_style='choice')] [04/10 06:22:48] d2.data.common INFO: Serializing the dataset using: <class 'detectron2.data.common._TorchSerializedList'> [04/10 06:22:48] d2.data.common INFO: Serializing 442 elements to byte tensors and concatenating them all ... [04/10 06:22:48] d2.data.common INFO: Serialized dataset takes 0.23 MiB [04/10 06:22:48] d2.evaluation.coco_evaluation INFO: Fast COCO eval is not built. Falling back to official COCO eval. [04/10 06:22:48] d2.evaluation.coco_evaluation WARNING: COCO Evaluator instantiated using config, this is deprecated behavior. Please pass in explicit arguments instead. [04/10 06:22:48] d2.evaluation.coco_evaluation INFO: Trying to convert 'voc_2007_val' to COCO format ... [04/10 06:22:48] d2.data.datasets.coco WARNING: Using previously cached COCO format annotations at './output/inference/voc_2007_val_coco_format.json'. You need to clear the cache file if your dataset has been modified. [04/10 06:22:48] d2.evaluation.evaluator INFO: Start inference on 442 batches [04/10 06:22:50] d2.evaluation.evaluator INFO: Inference done 11/442. Dataloading: 0.0007 s/iter. Inference: 0.0793 s/iter. Eval: 0.0003 s/iter. Total: 0.0803 s/iter. ETA=0:00:34 [04/10 06:22:55] d2.evaluation.evaluator INFO: Inference done 73/442. Dataloading: 0.0012 s/iter. Inference: 0.0791 s/iter. Eval: 0.0003 s/iter. Total: 0.0807 s/iter. ETA=0:00:29 [04/10 06:23:00] d2.evaluation.evaluator INFO: Inference done 134/442. Dataloading: 0.0012 s/iter. Inference: 0.0799 s/iter. Eval: 0.0003 s/iter. Total: 0.0816 s/iter. ETA=0:00:25 [04/10 06:23:05] d2.evaluation.evaluator INFO: Inference done 196/442. Dataloading: 0.0013 s/iter. Inference: 0.0796 s/iter. Eval: 0.0003 s/iter. Total: 0.0813 s/iter. ETA=0:00:19 [04/10 06:23:10] d2.evaluation.evaluator INFO: Inference done 259/442. Dataloading: 0.0013 s/iter. Inference: 0.0794 s/iter. Eval: 0.0003 s/iter. Total: 0.0811 s/iter. ETA=0:00:14 [04/10 06:23:15] d2.evaluation.evaluator INFO: Inference done 322/442. Dataloading: 0.0013 s/iter. Inference: 0.0793 s/iter. Eval: 0.0003 s/iter. Total: 0.0810 s/iter. ETA=0:00:09 [04/10 06:23:20] d2.evaluation.evaluator INFO: Inference done 384/442. Dataloading: 0.0013 s/iter. Inference: 0.0793 s/iter. Eval: 0.0003 s/iter. Total: 0.0809 s/iter. ETA=0:00:04 [04/10 06:23:25] d2.evaluation.evaluator INFO: Total inference time: 0:00:35.390397 (0.080985 s / iter per device, on 1 devices) [04/10 06:23:25] d2.evaluation.evaluator INFO: Total inference pure compute time: 0:00:34 (0.079222 s / iter per device, on 1 devices) [04/10 06:23:25] d2.evaluation.coco_evaluation INFO: Preparing results for COCO format ... [04/10 06:23:25] d2.evaluation.coco_evaluation INFO: Saving results to ./output/inference/coco_eval_instances_results.json [04/10 06:23:25] d2.evaluation.coco_evaluation INFO: Evaluating predictions with official COCO API... [04/10 06:23:29] d2.evaluation.coco_evaluation INFO: Evaluation results for bbox: AP AP50 AP75 APs APm APl
0.000 0.000 0.000 nan 0.000 0.000
[04/10 06:23:29] d2.evaluation.coco_evaluation INFO: Some metrics cannot be computed and is shown as NaN. [04/10 06:23:29] d2.evaluation.coco_evaluation INFO: Per-category bbox AP: category AP category AP category AP
A220 0.000 A320/321 0.000 A330 0.000
ARJ21 0.000 Boeing737 0.000 Boeing787 0.000
other 0.000

[04/10 06:23:29] d2.engine.defaults INFO: Evaluation results for voc_2007_val in csv format: [04/10 06:23:29] d2.evaluation.testing INFO: copypaste: Task: bbox [04/10 06:23:29] d2.evaluation.testing INFO: copypaste: AP,AP50,AP75,APs,APm,APl [04/10 06:23:29] d2.evaluation.testing INFO: copypaste: 0.0000,0.0000,0.0000,nan,0.0000,0.0000`

JoyeZLearning commented 5 months ago

It seems that there were something wrong with your data-processing, resulting the training invalid.

I‘ve uploaded my code 'voc2coco.py' to my repository and you can download it, hoping that can address your issue.

:)

2000YWQ commented 5 months ago

When I use your voc2coco.py, I still get the same result. image image This is the part of the json I converted: {"info": ["none"], "license": ["none"], "images": [{"file_name": "0000001.jpg", "height": 1500, "width": 1500, "id": 1}, {"file_name": "0000002.jpg", "height": 1200, "width": 1200, "id": 2}, {"file_name": "0000003.jpg", "height": 1200, "width": 1200, "id": 3}, {"file_name": "0000004.jpg", "height": 1500, "width": 1500, "id": 4}, {"file_name": "0000005.jpg", "height": 1200, "width": 1200, "id": 5}, {"file_name": "0000006.jpg", "height": 800, "width": 800, "id": 6}, {"file_name": "0000007.jpg", "height": 800, "width": 800, "id": 7}, {"file_name": "0000008.jpg", "height": 1000, "width": 1000, "id": 8}, {"file_name": "0000010.jpg", "height": 1500, "width": 1500, "id": 10}, {"file_name": "0000012.jpg", "height": 800, "width": 800, "id": 12}, {"file_name": "0000015.jpg", "height": 800, "width": 800, "id": 15}, {"file_name": "0000017.jpg", "height": 800, "width": 800, "id": 17}, {"file_name": "0000018.jpg", "height": 800, "width": 800, "id": 18}, {"file_name": "0000019.jpg", "height": 800, "width": 800, "id": 19}, {"file_name": "0000021.jpg", "height": 1500, "width": 1500, "id": 21}, {"file_name": "0000022.jpg", "height": 800, "width": 800, "id": 22}, {"file_name": "0000024.jpg", "height": 800, "width": 800, "id": 24}, {"file_name": "0000025.jpg", "height": 1200, "width": 1200, "id": 25}, {"file_name": "0000026.jpg", "height": 1000, "width": 1000, "id": 26}, {"file_name": "0000027.jpg", "height": 800, "width": 800, "id": 27}, {"file_name": "0000028.jpg", "height": 800, "width": 800, "id": 28}, {"file_name": "0000029.jpg", "height": 1500, "width": 1500, "id": 29}, {"file_name": "0000031.jpg", "height": 1500, "width": 1500, "id": 31}, {"file_name": "0000032.jpg", "height": 1200, "width": 1200, "id": 32},

GGyan commented 5 months ago

I also have the same problem, the calculated ap is all 0.I'm sure my labels are fine because they work fine on other models.

JoyeZLearning commented 5 months ago

Have you trained the model?.... you should train the model on your dataset and get the weight(.pth), then update it in config and default. From both of your results, I do not think you have run the codes rightly.......