mapbox / robosat

Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds
MIT License
2.02k stars 383 forks source link

Don't see any prediction with rs serve #218

Closed iboates closed 3 years ago

iboates commented 3 years ago

I am running the test Flask server on my GPU server, and it launches successfully but when I pan around, I don't get any results. This is supposed to be live prediction right? Or have I misunderstood?

I loaded my model checkpoint onto the server and then ran the server like this:

./rs serve --model vineyards/config/model-unet.toml --dataset vineyards/config/model-unet.toml --url https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}@2x.png --checkpoint ../checkpoint-00012-of-00100.pth --host=0.0.0.0

I have exported my mapbox token before this and have double-checked the paths to my model and dataset. But when I go to the page, I just see the satellite tiles and no prediction on top. Any ideas?

I don't even see any activity in the console output from Flask, nor any GPU activity from nvidia-smi when panning around.

I do notice however that the request is made in the browser to 127.0.0.1, but this would be pointing to my own local machine where I have the browser open, is there a way to get it to put to the source server itself?

image

daniel-j-h commented 3 years ago

Here are the two files you need to look at

The browser makes requests to localhost here

https://github.com/mapbox/robosat/blob/cbb1c73328183afd2d6351b7bfa3f430b73103ea/robosat/tools/templates/map.html#L74

If you run the serve tool on your gpu rig and change the line above to the gpu rig's ip it should work. As long as the html and the tiles are served from the same origin (host & port) you will be fine re. CORS, otherwise you probably need to add some CORS headers.

Also check the note in the readme please :bow:

https://github.com/mapbox/robosat/blob/cbb1c73328183afd2d6351b7bfa3f430b73103ea/README.md

iboates commented 3 years ago

@daniel-j-h Thanks for the tip, I didn't realize it was baked into the index.html. I was able to get it running.

RE: the note - just wondering what you meant by that, do you mean to say to not expect consistent support with issues on this github anymore?

daniel-j-h commented 3 years ago

Glad you got it running! :tada:

Exactly, this project is outdated by now for years and the Mapbox folks don't maintain it :crying_cat_face: Just want to be clear about this before folks put their time and effort into an abandoned project.

iboates commented 3 years ago

Ok, understood. I have my own hacked fork specifically for my purposes anyway. Is there a new project for the same purpose? Mapbox-affiliated or not. I saw that there was Robosat.pink but it seems that the creator actually passed away and nobody has maintained it since then.

daniel-j-h commented 3 years ago

Yes, sadly https://github.com/mapbox/robosat/issues/184

I'm not keeping track of the current state wrt. open source solutions in the robosat domain, sorry.

I do work on my own machine learning projects and can say with confidence that robosat by now could be orders of magnitude faster, cheaper to train/predict, and more accurate, with all the recent advances, tho.

Best, Daniel

On April 13, 2021 11:25:53 AM UTC, Isaac Boates @.***> wrote:

Ok, understood. I have my own hacked fork specifically for my purposes anyway. Is there a new project for the same purpose? Mapbox-affiliated or not. I saw that there was Robosat.pink but it seems that the creator actually passed away and nobody has maintained it since then.