estimating geolocation from image
1.1K
https://github.com/TIBHannover/GeoEstimation/tree/tf2
Run docker-compose up with the b/m docker-compose.yml and test endpoint with b/m API, body and check against expected results
version: '3.3'
services:
geoestimation:
ports:
- '5300:5300'
container_name: geoestimation
environment:
- PORT=5300
- APP_MODULE=app:app
- USE_HIERARCHY=false
volumes:
- '/home:/home'
restart: unless-stopped
image: echizen321/geoestimation_image
MODEL_PATH (default models/tf2_base_M/resnet-v2-101.tf2_base_M-keras.h5)
LABELS_PATH (default None, possible suggestion would meta/im2gps3k_places365.csv): path to ground truth labels (*for ground-truth referencing only)
CONFIDENCE_THRESHOLD (default 0.5): lower-bound threshold for results
USE_HIERARCHY (default false): set to "true" (case-sensitive) if want to use the hierarchy results (combined results of all cell resolution layers) even if it isn't the highest-confidence layer
SG_MODEL_PATH: for searching intra-SG if global models detects country as "Singapore"
SG_CONFIDENCE_THRESHOLD (default 0.5, can be increased with better training): lower-bound threshold for results if searching within SG
POST
http://172.17.0.1:5300/GeoEstimation
{
"fileLocation": "/home/plato/Desktop/few_images/gbtb_inside.jpg",
[THIS IS OPTIONAL] "threshold": 0.5
}
{
"results": {
"latlong": [
1.284451621125142,
103.86074515154986
],
"location": "Singapore",
"ratio_prediction_over_total": [
1.6994719943872585e-05,
1.9246462396506705e-08,
0.7788609941141376,
0.9999878001172502
]
}
}
Global classifier builds upon ResNet101V2 + Dense + softmax. During inference, it outputs a latlng which is then reverse-geocoded into a location
[added on 5/6/20] if country detected is "Singapore", another model (trained so far with VGG19 + a few Dense / Dropout layers + softmax) is run to attempt to find a finer area for Singapore
Possible issues: if global classifier doesn't determine Singapore, the finer model will not be used; if global classifier sees Singapore, the finer model will be used (subject to its own threshold as defined above). This may cause inaccurate fine-tuned results if the global classifier is wrong
Run docker run -it --entrypoint /bin/bash echizen321/geoestimation_image then cat training/singapore_places.txt from the app directory (should be default directory when you enter)
...
Content type
Image
Digest
Size
4.7 GB
Last updated
almost 6 years ago
docker pull echizen321/geoestimation_image