Turoad / lanedet

An open source lane detection toolbox based on PyTorch, including SCNN, RESA, UFLD, LaneATT, CondLane, etc.
Apache License 2.0
565 stars 93 forks source link

Inference code #2

Closed cf206cd closed 3 years ago

cf206cd commented 3 years ago

It would be nicer if you can add inference code! And why there is no MobileNet in backbone? Does it not work well for this task?

Turoad commented 3 years ago

Thank for your interest.

What is you need in the inference code, e.g., do visualization? Currently, we support visualization in validate phase by adding --view.

As for MoblieNet, We haven't tested it. We will consider testing it and updating the configs. It may have faster inference speed but relatively low accuracy.

cf206cd commented 3 years ago

Well, not only visualization, some (including me) may need to deploy it on some embedding devices, so maybe we can implement a class to do inference without complicated config and data loader?

Turoad commented 3 years ago

OK, I will consider add the inference code. The config cannot be removed. We need the config to define network, preprocess or others.

cf206cd commented 3 years ago

And maybe another advice... It would be better if you can change the input of the model to be only images just like mmdetection. It seems to be a batch with both images and labels now and it`s not convenient for inference. Thank you for your good job!

Turoad commented 3 years ago

The input is a dict. If you don't have labels, just get the img, like this: https://github.com/Turoad/lanedet/blob/main/lanedet/models/net/detector.py#L19. If the dataset don't have any label, we can handle this case. I don't think it's inconvenient.

Turoad commented 3 years ago

By the way, we don't have labels during validate in a batch. Do you run the code and get labels?

Turoad commented 3 years ago

@cf206cd I have added the MobileNetV2(https://github.com/Turoad/lanedet/blob/main/configs/laneatt/resnet18_culane.py) and the tools/detect.py.

cf206cd commented 3 years ago

Wow! Amazing! Thank you so much!