Spaces:
Sleeping
Sleeping
Download ecolayers from HF dataset
Browse files- annual_mean_air_temp.tif +0 -3
- annual_precipitation.tif +0 -3
- app.py +10 -1
- human_footprint.tiff +0 -3
- median_elevation_1km.tiff +0 -3
- population_density_1km.tif +0 -3
- precipitation_seasonality.tif +0 -3
- temp_seasonality.tif +0 -3
annual_mean_air_temp.tif
DELETED
Git LFS Details
|
annual_precipitation.tif
DELETED
Git LFS Details
|
app.py
CHANGED
|
@@ -12,13 +12,22 @@ from sklearn.preprocessing import LabelEncoder
|
|
| 12 |
import torch
|
| 13 |
from torch import nn
|
| 14 |
from transformers import BertConfig, BertForMaskedLM, PreTrainedTokenizerFast
|
| 15 |
-
from huggingface_hub import PyTorchModelHubMixin
|
| 16 |
from pinecone import Pinecone
|
| 17 |
import rasterio
|
| 18 |
from rasterio.sample import sample_gen
|
| 19 |
|
| 20 |
from config import DEFAULT_INPUTS, MODELS, DATASETS, ID_TO_GENUS_MAP, LAYER_NAMES
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# We need this for the eco layers because they are too big
|
| 23 |
PIL.Image.MAX_IMAGE_PIXELS = None
|
| 24 |
|
|
|
|
| 12 |
import torch
|
| 13 |
from torch import nn
|
| 14 |
from transformers import BertConfig, BertForMaskedLM, PreTrainedTokenizerFast
|
| 15 |
+
from huggingface_hub import PyTorchModelHubMixin, hf_hub_download
|
| 16 |
from pinecone import Pinecone
|
| 17 |
import rasterio
|
| 18 |
from rasterio.sample import sample_gen
|
| 19 |
|
| 20 |
from config import DEFAULT_INPUTS, MODELS, DATASETS, ID_TO_GENUS_MAP, LAYER_NAMES
|
| 21 |
|
| 22 |
+
# Download ecolayers from HF dataset
|
| 23 |
+
for image_name in LAYER_NAMES:
|
| 24 |
+
hf_hub_download(
|
| 25 |
+
repo_id="LofiAmazon/Global-Ecolayers",
|
| 26 |
+
filename=image_name,
|
| 27 |
+
repo_type="dataset",
|
| 28 |
+
local_dir=".",
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
# We need this for the eco layers because they are too big
|
| 32 |
PIL.Image.MAX_IMAGE_PIXELS = None
|
| 33 |
|
human_footprint.tiff
DELETED
Git LFS Details
|
median_elevation_1km.tiff
DELETED
Git LFS Details
|
population_density_1km.tif
DELETED
Git LFS Details
|
precipitation_seasonality.tif
DELETED
Git LFS Details
|
temp_seasonality.tif
DELETED
Git LFS Details
|