facebookresearch / facebookresearch/detectron2
No use cv2.VideoCapture
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hello.
Thank you for sharing your source.
I'd like to receive video frames with other method in 'demo.py'
I'm using Azure Kinect Camera and I run this camera in ROS.
With cv_bridge, I convert ros topic(rgb image) to cv_image.
The cv_images are transmitted to 'demo.py' by TCP/IP
The above process was successful and I'm trying to put cv_image to inference code.
But I have trouble doing this.
Please let me know if you have tried the above or if you know how to do it.
Thanks in advance.
..................................................................................................................................................................................................
[07/15 13:04:35 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml', input=None, opts=['MODEL.WEIGHTS', 'detectron2/models/model_final_a54504.pkl'], output=None, video_input=None, webcam=True)
[07/15 13:04:37 fvcore.common.checkpoint]: [Checkpointer] Loading from detectron2/models/model_final_a54504.pkl ...
[07/15 13:04:38 fvcore.common.checkpoint]: Reading a file from 'Detectron2 Model Zoo'
0it [00:00, ?it/s]frame_gen.shape
(1024, 512, 3)
0it [00:00, ?it/s]
Traceback (most recent call last):
File "detectron2/demo/client_det.py", line 166, in
for vis in tqdm.tqdm(demo.run_on_video()):
File "/home/unstruct/anaconda3/envs/combination/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/home/unstruct/combination/detectron2/demo/predictor.py", line 162, in run_on_video
yield process_predictions(frame, self.predictor(frame))
File "/home/unstruct/combination/detectron2/detectron2/engine/defaults.py", line 314, in __call__
image = torch.as_tensor(image.astype("uint8").transpose(2, 0, 1))
ValueError: axes don't match array
..................................................................................................................................................................................................
I got an error like above.
Contributor guide
Assessment
This issue has not been assessed yet.