Skip to content
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

Feature : Support .tflite Predictions #2

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

kshitijrajsharma
Copy link
Member

@kshitijrajsharma kshitijrajsharma commented Oct 19, 2023

  • Supprots tflite predictions which will remove the dependency from huge tensorflow making it very light and easy for deployment of inference module

**How to test ? **

  • Download .tflite model
  • Change extension to tests/app_test.py inlcude your .tflite , only install tflite-runtime , Don't install whole tensorflow , Try to run the prediction

Example :

  • Install fairpredictor
  • Install tflite-runtime
  • Download .tflite model from fAIr

Run Following

**from predictor import predict

model_path = "checkpoint.tflite"
bbox = [100.56228021333352, 13.685230854641182, 100.56383321235313, 13.685961853747969]
zoom_level = 20
tms_url = "https://tiles.openaerialmap.org/6501a65c0906de000167e64d/0/6501a65c0906de000167e64e/{z}/{x}/{y}"

bbox = [100.56228021333352, 13.685230854641182, 100.56383321235313, 13.685961853747969]
zoom_level = 20
tms_url = "https://tiles.openaerialmap.org/6501a65c0906de000167e64d/0/6501a65c0906de000167e64e/{z}/{x}/{y}"

my_predictions = predict(bbox, model_path, zoom_level, tms_url, remove_metadata=False)
print(my_predictions)
**

TODO

  • Clean up the predict.py , currently its very messy and lot of repetition of code

@kshitijrajsharma kshitijrajsharma merged commit 9e526e6 into master Oct 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant