|
2 | 2 |
|
3 | 3 | Run your fAIr Model Predictions anywhere ! |
4 | 4 |
|
5 | | -## Example on Collab |
| 5 | +## Example on python |
6 | 6 | ```python |
7 | 7 | # Install |
8 | 8 | !pip install fairpredictor |
9 | 9 |
|
10 | | -# Import |
11 | | -from predictor import predict, DEFAULT_OAM_TMS_MOSAIC, DEFAULT_RAMP_MODEL |
12 | | -import asyncio |
| 10 | +import asyncio |
13 | 11 |
|
14 | | -# Parameters for your predictions |
15 | | -bbox=[100.56228021333352,13.685230854641182,100.56383321235313,13.685961853747969] |
16 | | -model_path=DEFAULT_RAMP_MODEL |
17 | | -zoom_level=20 |
18 | | -tms_url=DEFAULT_OAM_TMS_MOSAIC |
| 12 | +from predictor import DEFAULT_OAM_TMS_MOSAIC, DEFAULT_RAMP_MODEL, predict |
19 | 13 |
|
20 | | -# Run your prediction |
21 | | -my_predictions=asyncio.run(predict(bbox,model_path,zoom_level,tms_url)) |
22 | | -print(my_predictions) |
23 | | - |
24 | | -## Visualize your predictions |
| 14 | +# Parameters for your predictions |
| 15 | +bbox = [100.56228021333352, 13.685230854641182, 100.56383321235313, 13.685961853747969] |
| 16 | +model_path = DEFAULT_RAMP_MODEL |
| 17 | +zoom_level = 20 |
| 18 | +tms_url = DEFAULT_OAM_TMS_MOSAIC |
25 | 19 |
|
26 | | -import geopandas as gpd |
27 | | -import matplotlib.pyplot as plt |
28 | | -gdf = gpd.GeoDataFrame.from_features(my_predictions) |
29 | | -gdf.plot() |
30 | | -plt.show() |
| 20 | +# Run your prediction |
| 21 | +my_predictions = asyncio.run(predict(bbox, model_path, zoom_level, tms_url)) |
| 22 | +print(my_predictions) |
31 | 23 | ``` |
32 | 24 |
|
33 | 25 | Works on CPU ! Can work on serverless functions, No other dependencies to run predictions |
|
0 commit comments