wayveai / mile

PyTorch code for the paper "Model-Based Imitation Learning for Urban Driving".
MIT License
355 stars 34 forks source link

Questions about data collection #13

Closed KevinDu1 closed 1 year ago

KevinDu1 commented 1 year ago

Thanks for your good work! I started reproducing this article before, and I found that the code for the agents folder is missing in this version. In addition, in the recent version, it was found that the birdview pictures collected during data collection were all black

anthonyhu commented 1 year ago

Hello! Thank you the kind words. There has been some recent changes on the repository, could you pull main again?

For the bird's-eye view images, they appear as black when you open them but they do contain a class id. If you'd like to visualise them you can do

from mile.constants import BIRDVIEW_COLOURS

birdview = np.array(Image.open('path_to_birdview.png'))
birdview = BIRDVIEW_COLOURS[birdview]
KevinDu1 commented 1 year ago

No, I can not pull main again. I run the following code, bash run/data_collect.sh ~/carla11/CarlaUE4.sh dataset/ 2000 config/test_suites/lb_data.yaml

It gives the following error: File "~/mile-main/mile/data/dataset_utils.py", line 7, in from agents.navigation.local_planner import RoadOption ModuleNotFoundError: No module named 'agents'

In the process of changes recently, I think some of the scripts are not updated.

anthonyhu commented 1 year ago

Oh that's because you need to add the following to the pythonpath:

export PYTHONPATH="${CARLA_ROOT}/PythonAPI/carla/"

KevinDu1 commented 1 year ago

I can collect the data and run all the scripts, thanks for the sharing. But this code can not work and gives IndexError: index 10 is out of bounds for axis 0 with size 8 for 'birdview = BIRDVIEW_COLOURS[birdview]'.

Hello! Thank you the kind words. There has been some recent changes on the repository, could you pull main again?

For the bird's-eye view images, they appear as black when you open them but they do contain a class id. If you'd like to visualise them you can do

from mile.constants import BIRDVIEW_COLOURS

birdview = np.array(Image.open('path_to_birdview.png'))
birdview = BIRDVIEW_COLOURS[birdview]
anthonyhu commented 1 year ago

Ah apologies - the proper way to visualise the labels are by loading the CarlaDataset (mile/data/dataset.py). Then a combination of batch['birdview_label'] and BIRDVIEW_COLOURS should allow you to visualise them.

KevinDu1 commented 1 year ago

Thank you for your answer

Syk-yr commented 1 month ago

Excuse me, can you provide a visual code example? thank you very much indeed.