voldemortX / pytorch-auto-drive

PytorchAutoDrive: Segmentation models (ERFNet, ENet, DeepLab, FCN...) and Lane detection models (SCNN, RESA, LSTR, LaneATT, BézierLaneNet...) based on PyTorch with fast training, visualization, benchmarking & deployment help
BSD 3-Clause "New" or "Revised" License
837 stars 137 forks source link

How can i run it in a realtime image #112

Open stiglioglu opened 2 years ago

stiglioglu commented 2 years ago

How can i run it in a realtime image

voldemortX commented 2 years ago

@stiglioglu We don't have camera APIs, if that is what you want.

I think your use case is similar to a video input? We have a video-inference-visualize pipeline:

https://github.com/voldemortX/pytorch-auto-drive/blob/master/docs/VISUALIZATION.md#segmentation-mask-video

stiglioglu commented 2 years ago

Thank you for your answer. I want to run on ros camera topic. How can I run on snapshot eg image from webcam.

voldemortX commented 2 years ago

The general method is read the image, make the testing transforms (e.g., resize), then inference, finally apply specific post-processings. For some lane detection methods, they already have a inference() method, which includes the post-process.

An lane example is https://github.com/voldemortX/pytorch-auto-drive/blob/9ec8172481b6d38201bdc2308caadc8a5feb02f5/utils/runners/lane_det_visualizer.py#L153

stiglioglu commented 2 years ago

where do you read the video frames can you help me i couldn't find it

voldemortX commented 2 years ago

where do you read the video frames can you help me i couldn't find it

We use a torch style dataloader for video reading: https://github.com/voldemortX/pytorch-auto-drive/blob/master/utils/datasets/video.py