Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,8 @@ from sentinelhub import SHConfig
|
|
| 23 |
# config = SHConfig(config_location=CONFIG_FILE)
|
| 24 |
config = SHConfig(
|
| 25 |
use_defaults=True,
|
| 26 |
-
sh_client_id=os.getenv("
|
| 27 |
-
sh_client_secret=os.getenv("
|
| 28 |
)
|
| 29 |
|
| 30 |
app = FastAPI()
|
|
@@ -51,16 +51,16 @@ clf = joblib.load('./deforestation_percentage_model.joblib')
|
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
-
print("Using config dir:", os.getenv("SENTINELHUB_CONFIG_FOLDER"))
|
| 55 |
|
| 56 |
|
| 57 |
-
CONFIG_PATH = "/app/.config/sentinelhub/config.json"
|
| 58 |
-
os.makedirs(os.path.dirname(CONFIG_PATH), exist_ok=True)
|
| 59 |
|
| 60 |
-
# Use a custom config location
|
| 61 |
-
config = SHConfig(config_location=CONFIG_PATH)
|
| 62 |
-
config.sh_client_id =os.getenv('SENTINENTAL_ID')
|
| 63 |
-
config.sh_client_secret =os.getenv('SENTINENTAL_PASS')
|
| 64 |
|
| 65 |
|
| 66 |
class DeforestationRequest(BaseModel):
|
|
|
|
| 23 |
# config = SHConfig(config_location=CONFIG_FILE)
|
| 24 |
config = SHConfig(
|
| 25 |
use_defaults=True,
|
| 26 |
+
sh_client_id=os.getenv("id"),
|
| 27 |
+
sh_client_secret=os.getenv("secret")
|
| 28 |
)
|
| 29 |
|
| 30 |
app = FastAPI()
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
+
# print("Using config dir:", os.getenv("SENTINELHUB_CONFIG_FOLDER"))
|
| 55 |
|
| 56 |
|
| 57 |
+
# CONFIG_PATH = "/app/.config/sentinelhub/config.json"
|
| 58 |
+
# os.makedirs(os.path.dirname(CONFIG_PATH), exist_ok=True)
|
| 59 |
|
| 60 |
+
# # Use a custom config location
|
| 61 |
+
# config = SHConfig(config_location=CONFIG_PATH)
|
| 62 |
+
# config.sh_client_id =os.getenv('SENTINENTAL_ID')
|
| 63 |
+
# config.sh_client_secret =os.getenv('SENTINENTAL_PASS')
|
| 64 |
|
| 65 |
|
| 66 |
class DeforestationRequest(BaseModel):
|