Comments (8)
Adding --eval bbox segm
will evaluate both bbox AP and mask AP.
from mmdetection.
Thanks for your quick reply!
I used to retrain using "/configs/mask_rcnn_r50_fpn_1x.py"," ./work_dirs/mask_rcnn_r50_fpn_1x/", and
"--eval bbox segm --show"
but only show the detection result, no segmentation result.
from mmdetection.
I see, you mean the visualization, not evaluation. The eval
argument is for mAP evaluation, and the visualization method is implemented here.
Currently we only visualize the bbox, and will further add mask visualization. You can temporally enable it by replacing the original show_result()
with the following method.
def show_result(self,
data,
result,
img_norm_cfg,
dataset='coco',
score_thr=0.3):
assert isinstance(result, tuple)
bbox_result, segm_result = result
img_tensor = data['img'][0]
img_metas = data['img_meta'][0].data[0]
imgs = tensor2imgs(img_tensor, **img_norm_cfg)
assert len(imgs) == len(img_metas)
if isinstance(dataset, str):
class_names = get_classes(dataset)
elif isinstance(dataset, list):
class_names = dataset
else:
raise TypeError('dataset must be a valid dataset name or a list'
' of class names, not {}'.format(type(dataset)))
for img, img_meta in zip(imgs, img_metas):
h, w, _ = img_meta['img_shape']
img_show = img[:h, :w, :]
labels = [
np.full(bbox.shape[0], i, dtype=np.int32)
for i, bbox in enumerate(bbox_result)
]
labels = np.concatenate(labels)
bboxes = np.vstack(bbox_result)
segms = mmcv.concat_list(segm_result)
inds = np.where(bboxes[:, -1] > score_thr)[0]
for i in inds:
color_mask = np.random.randint(0, 256, (1, 3), dtype=np.uint8)
mask = maskUtils.decode(segms[i]).astype(np.bool)
img_show[mask] = img_show[mask] * 0.5 + color_mask * 0.5
mmcv.imshow_det_bboxes(
img_show,
bboxes,
labels,
class_names=class_names,
score_thr=score_thr)
from mmdetection.
Thanks.
some error happens.
- class 'tensor2imgs' not defined,
from mmdet.core import tensor2imgs - class 'get_classes' is not defined
from mmdet.core import get_classes - import np
- maskUtils.decode this can not find in your repo. Please update
Thanks!
from mmdetection.
Oh I forgot to paste the import-statements.
import numpy as np
import pycocotools.mask as maskUtils
from mmdet.core import tensor2imgs, get_classes
from mmdetection.
Excellent, I can show the segmentation result.
Thanks!
from mmdetection.
Hi @Minotaur-CN , I follow the answer from Dr. Chen Kai above. The "Mask_rcnn.py" under mmdetection/mmdet/models/detectors has been modified, and then run the command "python3 tools/test.py configs/mask_rcnn_r50_fpn_1x.py checkpoints/mask_rcnn/mask_rcnn_r50_fpn_1x_20181010-069fa190.pth --show" , why is it still only bbox, what am I doing wrong?
from mmdetection.
@Curry1201 You can try the latest version.
from mmdetection.
Related Issues (20)
- How to use the intel camera api
- AnchorGenerator not generating complete anchors at frequent strides
- 使用最新的mmdetection框架的mask rcnn使用自己的数据集去训练多种类别的模型时出现了一个问题,比如训练35种类别,训练出来的模型识别跟mmdet/evaluation/functional/class_names.py文件和mmdet/datasets/coco.py中放入的类别的顺序有关,只要有一个放置错误,识别时类别就会反过来,而且我并不能知道这个多类别在文件放置的顺序,这个应该怎么办,是哪里的设置需要修改吗还是一个bug?
- 无法debug到模型源码 HOT 2
- 权重文件的使用方法 HOT 1
- Bbox feats (embeddings) from ONNX model
- grad_norm is abnormal in the initial stage of training. Is this normal?
- TypeError: FasterRCNN.__init__() got an unexpected keyword argument 'bbox_head'
- How to train a model with different task datasets at the same time?
- python tools/train.py configs/yolox/yolox_tiny_8xb8-300e_coco.py, than report AssertionError:
- "CoDINOHead is not registered" occurs when running the codetr model. HOT 1
- How to Load a Close-set Fine-tuned Grounding Dino into Grounded SAM
- python demo/image_demo.py ...... error : Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. in windows11
- fps benchmark tool can't work
- Training Mask RCNN without BBox HOT 1
- Save only detected images
- [mm grounding dino]
- Evaluating after training nuscenes mini dataset
- Purpose allow_negative_crop in train_pipeline of MM Grounding DINO
- Fine tune Grounding DINO as open set with custom coco HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmdetection.