https://github.com/hayabhay/megadetector-gcf
MegaDetector v4.1.0 served as a Google Cloud Function
https://github.com/hayabhay/megadetector-gcf
Last synced: about 1 month ago
JSON representation
MegaDetector v4.1.0 served as a Google Cloud Function
- Host: GitHub
- URL: https://github.com/hayabhay/megadetector-gcf
- Owner: hayabhay
- Archived: true
- Created: 2022-09-10T02:37:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-10T02:39:26.000Z (almost 3 years ago)
- Last Synced: 2025-03-04T05:14:02.419Z (4 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cloud function to run MegaDetector
This function runs MegaDetector inference on a single image.
Image source can be either a web url, a google storage uri (needs access to the project)
or raw binary image data.Objects, if detected, can be found in the "detections" key in the returned payload.
For local dev, run the following command inside the `megadetector` directory after installing`requirements-dev.txt`
```
pip install -r requirements-dev.txt
functions-framework --target detect --debug
```Be sure to run pre-commit before committing the code
```
git add -u
pre-commit run --all
```
Note: This is mostly for formatting and other glaring gotchas. Feel free to ignore overly specific style issues.Deploy using
```
gcloud functions deploy --entry-point detect --runtime python39 --trigger-http --region=us-west2 --memory=8192 --timeout=540s
```