Skip to main content

A package for running predictions using fAIr

Project description

fAIr Predictor

Run your fAIr Model Predictions anywhere !

Prerequisites

fAIr Predictor has support for GPU , CPU and tflite based devices

  • Install tensorflow-cpu or tflite-runtime according to your requirements

tflite-runtime support is for having very light deployment in order to run inference & tensorflow-cpu might require installation of efficientnet

Example on Collab

# Install 
!pip install fairpredictor

# Import 
from predictor import predict

# Parameters for your predictions 
bbox=[100.56228021333352,13.685230854641182,100.56383321235313,13.685961853747969]
model_path='checkpoint.h5'
zoom_level=20
tms_url='https://tiles.openaerialmap.org/6501a65c0906de000167e64d/0/6501a65c0906de000167e64e/{z}/{x}/{y}'

# Run your prediction 
my_predictions=predict(bbox,model_path,zoom_level,tms_url)
print(my_predictions)

## Visualize your predictions 

import geopandas as gpd
import matplotlib.pyplot as plt
gdf = gpd.GeoDataFrame.from_features(my_predictions)
gdf.plot()
plt.show()

Works on CPU ! Can work on serverless functions, No other dependencies to run predictions

Use raster2polygon

There is another postprocessing option that supports distance threshold between polygon for merging them , If it is useful for you install raster2polygon by :

pip install raster2polygon

Load Testing

CAUTION : Always take permission of server admin before you perform load test

In order to perform load testing we use Locust , To enable this hit following command within the root dir

  • Install locust

    pip install locust
    
  • Run locust script

    locust -f locust.py
    

Populate your HOST and replace it with BASE URL of the Predictor URL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fairpredictor-0.0.32.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

fairpredictor-0.0.32-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file fairpredictor-0.0.32.tar.gz.

File metadata

  • Download URL: fairpredictor-0.0.32.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for fairpredictor-0.0.32.tar.gz
Algorithm Hash digest
SHA256 1f75e79951c02fa09049ba03de0257be56f1d72b2182ae1a8490a9932904a99a
MD5 b597d507699a5bbcb08f2712a60977a8
BLAKE2b-256 2e8f8dbf037ab185bc643c772eb426938f230361e1a30fd4878e6c6dd78dcdeb

See more details on using hashes here.

File details

Details for the file fairpredictor-0.0.32-py3-none-any.whl.

File metadata

File hashes

Hashes for fairpredictor-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 53100de3a80e875141953e267e4f9a883776ac569c5d51adb464f37f673078d6
MD5 143a3c3d10686a180f44534cc78ef1a4
BLAKE2b-256 282769587ef021186bb94043f818ef9ceef32830f9291a54aed471d12bfc2536

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page