open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.53k stars 9.46k forks source link

Unable to get video output. #4048

Closed neomukul closed 3 years ago

neomukul commented 4 years ago

Hello team, Thank you for this tool it's very exciting to work with it but whenever I am running it on a video, it's running and exit's without any error, can you please suggest any solution??? I've trained my model on a custom dataset.

from mmdet.apis import init_detector, inference_detector import mmcv

config_fname = 'configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_2x_coco.py' checkpoint_file = 'epoch_250.pth'

model = init_detector(config_fname, checkpoint_file)

build the model from a config file and a checkpoint file

model = init_detector(config_fname, checkpoint_file, device='cuda:0')

test a video and show the results

video = mmcv.VideoReader('peoples_HCI_107235.mp4') for frame in video: result = inference_detector(model, frame) model.show_result(frame, result)

ZwwWayne commented 4 years ago

This might be a bug, we will try to reproduce your bug first.

xvjiarui commented 3 years ago

Hi @neomukul

You may try model.show_result(frame, result, show=True) if you are using a local machine.