Skip to content

Commit 667913f

Browse files
fix: update README example to reflect correct import and usage for predictions
1 parent b265198 commit 667913f

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

README.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,24 @@
22

33
Run your fAIr Model Predictions anywhere !
44

5-
## Example on Collab
5+
## Example on python
66
```python
77
# Install
88
!pip install fairpredictor
99

10-
# Import
11-
from predictor import predict, DEFAULT_OAM_TMS_MOSAIC, DEFAULT_RAMP_MODEL
12-
import asyncio
10+
import asyncio
1311

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
1913

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
2519

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)
3123
```
3224

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

0 commit comments

Comments
 (0)