Closed dwddw closed 8 months ago
I found test.py doesn't "inference by patches", it seems just resize the input into (1024, 1024). I use mmrotate.apis.inference_detector_by_patches
to generate result, and get 0.73+ mAP50. :)
I found test.py doesn't "inference by patches", it seems just resize the input into (1024, 1024). I use
mmrotate.apis.inference_detector_by_patches
to generate result, and get 0.73+ mAP50. :)
hello, I met the same problem. Could you provide the details how to solve the problem? Thanks so much 😸
I found test.py doesn't "inference by patches", it seems just resize the input into (1024, 1024). I use
mmrotate.apis.inference_detector_by_patches
to generate result, and get 0.73+ mAP50. :)hello, I met the same problem. Could you provide the details how to solve the problem? Thanks so much 😸
Try this:
`import os from tqdm import tqdm from mmcv import Config from mmdet.apis import init_detector from mmrotate.apis import inference_detector_by_patches from mmrotate.datasets import build_dataset from mmrotate.utils import compat_cfg
if name == 'main':
cfg_file = 'work_dirs/rotated_retinanet_obb_r50_fpn_1x_dota_le90/rotated_retinanet_obb_r50_fpn_1x_dota_le90.py'
ckpt_file = 'work_dirs/rotated_retinanet_obb_r50_fpn_1x_dota_le90/epoch_12.pth'
device = 'cuda:0'
results = []
cfg = Config.fromfile(cfg_file)
cfg = compat_cfg(cfg)
cfg.data.test.test_mode = True
img_folder = os.path.join(cfg.get('data_root'), 'test/images/')
dataset = build_dataset(cfg.data.test)
model = init_detector(cfg_file, ckpt_file, device)
for img_name in tqdm(os.listdir(img_folder)):
if img_name.endswith('.png'):
img_file = os.path.join(img_folder, img_name)
result = inference_detector_by_patches(model, img_file, [1024], [824], [1.0], 0.1)
results.extend([result])
out = dataset.format_results(results, submission_dir='submission', nproc=1)
`
Hello! I have downloaded your config file "dn_arw_arm_arcsl_rdetr_r50_dota.py" from https://github.com/httle/ARS-DETR/blob/ars/configs/ars_detr/dn_arw_arm_arcsl_rdetr_r50_dota.py and model "dn_arw_arm_arcsl_rdetr.pth" from https://1drv.ms/u/s!AsmpWJamS0mRgQLIqpXPR5jzLNxo?e=EgP5Gp, then I ran
then I uploaded "ARSDETR.zip" to Evaluation of DOTA Task1 Serverhttp://bed4rs.net:8001/evaluation1/, but got very low mAP and very strange ap of each class:
Same problem occured when I submit zip file obtained by other models, such as rotated retinanet.
python .\tools\test.py .\ARS_DETR\detr_r50_dota.py "dn_arw_arm_arcsl_rdetr.pth" --format-only --eval-options submission_dir=ARSDETR
refer to the https://mmrotate.readthedocs.io/en/latest/get_started.html#test-a-model, got an zip file:But when I train a model, the printed information is normal,
{"mode": "val", "epoch": 12, "iter": 12800, "lr": 3e-05, "mAP": 0.47785, "AP50": 0.776, "AP55": 0.753, "AP60": 0.723, "AP65": 0.668, "AP70": 0.603, "AP75": 0.51, "AP80": 0.385, "AP85": 0.244, "AP90": 0.095, "AP95": 0.022}
, although this is the results on train+val set. And I can get only 0.4 AP50 with models trained by myself.Can you tell me what could be causing this? I've been searching and haven't found anyone with the same problem as me.
Thanks!