-
Notifications
You must be signed in to change notification settings - Fork 2
FastAPI for Landsat vessel detection #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f8f5c3e
to
eeb8792
Compare
After force push, the log history is cleaned up. |
009fea9
to
eeb8792
Compare
@pbeukema I am doing github actions in a seperate PR |
3f7c55a
to
02ab349
Compare
@pbeukema I couldn’t add you as a reviewer, but could you take a look at this PR? |
@mikerjacobi Here's the fastapi for landsat. |
I added a test and it looks like everything is working well but originally we were thinking the |
rslp/landsat_vessels/api_main.py
Outdated
image_files: dict[str, str] | None = None | ||
crop_path: str | ||
scratch_path: str | ||
json_path: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json_path should be optional since Skylight can read the JSON from the response body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, made json_path
optional now.
rslp/landsat_vessels/api_main.py
Outdated
|
||
scene_id: str | None = None | ||
image_files: dict[str, str] | None = None | ||
crop_path: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice for crop_path to be optional as well. If you don't make it optional then in the test I added, crop_path should be changed to be a subdirectory of the scratch_path, otherwise it writes the crops in the current directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Also leave it as None in the test, so that we can query API just with a scene_id.
rslp/landsat_vessels/api_main.py
Outdated
scene_id: str | None = None | ||
image_files: dict[str, str] | None = None | ||
crop_path: str | ||
scratch_path: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think scratch_path is fine to be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…s into pbeukema/fastapi
OK, I made all three arguments Optional for api, we may just need the returned json response. And if specified, they can be saved as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was failing for me with two issues:
- tmp_dir.cleanup only exists when doing
tmp_dir = tempfile.TemporaryDirectory()
, but it was usingwith tempfile.TemporaryDirectory() as tmp_dir
, in the latter case it is just a string while in the former it is object where the directory name (string) can be accessed withtmp_dir.name
. - b8_fname/rgb_fname were used but not defined if crop_path is not passed.
It seems to be working now. I excluded it from test because it needs GPU, so I put it in tests/integration_slow/
.
Thanks for the fix! I still got the following error, and it seems the prediction pipeline took very long (> 20 minutes) to run on the test scene. The materializing ran fast, but the preparing windows for classifier took long to complete (more than 1K windows here).
|
Could it be not enough shared memory? |
After reducing batch_size, the issue resolved. |
FastAPI for Landsat vessel detection
Uh oh!
There was an error while loading. Please reload this page.