mitroadmaps / roadtracer

MIT License
235 stars 76 forks source link

Inference on imagery for which we don't have graph #19

Closed chrishna1 closed 6 years ago

chrishna1 commented 6 years ago

Hi, To run infer.py we need to pass two arguments; that is the path of graph and starting_locations. Since both is available for 40 cities data set, it is working fine over them. But what if we want to infer on entirely new region for which I've downloaded the required imagery using 1_sat.go ?

Is there any workaround for this or do we need to download them first to proceed forward ?

On a different note : For applying Roadtracer on a new region we also need to pass --r switch, which contains the name of the region otherwise by default it assumes chicago or reassign REGION .

uakfdotb commented 6 years ago

In a typical application users will have an existing street map and want to find roads that are in the imagery but missing from their map. So using the EXISTING_GRAPH_FNAME setting in infer.py, RoadTracer will use starting locations along the existing road network and only infer segments along roads that didn't appear in the existing map.

For a region where there is no map at all, there are two things you'd need to do:

1) Set USE_TL_LOCATIONS=False and set MANUAL_POINT1 and MANUAL_POINT2 to be the pixel position of a point on the road network in an image tile. You can set the position of the tile with MANUAL_RELATIVE. 2) Would recommend two-phase inference approach, see https://github.com/mitroadmaps/roadtracer/tree/master/roadtracer#starting-from-multiple-locations . The first phase will use your MANUAL_POINTs to infer many segments with low confidence threshold, then in second phase it will use the segments from first phase as starting locations to infer road network with high confidence threshold.

Edit: the code still requires graph path but if it complains about graph file not existing you can just create it as an empty file. Only the starting_locations file is used, but if you use MANUAL_POINTs then it is not used either.

ntelo007 commented 4 years ago

Could you please post an example command for infering with new image data? I already applied the change (insert manual points, change USE_TL_LOCATIONS=False) but I can't make it run.

uakfdotb commented 4 years ago

ntelo007 What error do you get?

In practice it makes sense to start with the existing map (like OpenStreetMap) and use tool like RoadTracer to add more roads. (With this RoadTracer code you can use --g option to pass the existing map.)

Usually it would not make sense to infer a new map from scratch, that is useless map because it ignores the existing high-quality data. It is not a real problem.

ntelo007 commented 4 years ago

@uakfdotb Please have a look at issue #31 to see about the error I get.

The reason why I would like to test the algorithm on a new image is to understand how it works and identify its limitations. There are thousands of roads still not mapped in underdeveloped countries, which could get benefited by such algortihms.