Spaces:
Sleeping
Sleeping
Amina commited on
Commit ·
87af6f1
1
Parent(s): d53b194
Changes to app.py
Browse files- app.py +2 -0
- index.html → front/index.html +1 -1
app.py
CHANGED
|
@@ -2,7 +2,9 @@ from fastapi import FastAPI, File, UploadFile
|
|
| 2 |
from PIL import Image
|
| 3 |
import torch
|
| 4 |
import io
|
|
|
|
| 5 |
|
|
|
|
| 6 |
app = FastAPI(title="Car Damage Detection API")
|
| 7 |
|
| 8 |
# Load custom YOLOv8 model.
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
import torch
|
| 4 |
import io
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
+
os.environ['TORCH_HOME'] = '/tmp/torch_cache'
|
| 8 |
app = FastAPI(title="Car Damage Detection API")
|
| 9 |
|
| 10 |
# Load custom YOLOv8 model.
|
index.html → front/index.html
RENAMED
|
@@ -41,7 +41,7 @@
|
|
| 41 |
|
| 42 |
<script>
|
| 43 |
// ⚠️ IMPORTANT: REPLACE THIS URL with your actual Hugging Face Space URL!
|
| 44 |
-
const API_URL = "https://
|
| 45 |
|
| 46 |
const uploadArea = document.getElementById('upload-area');
|
| 47 |
const imageUpload = document.getElementById('image-upload');
|
|
|
|
| 41 |
|
| 42 |
<script>
|
| 43 |
// ⚠️ IMPORTANT: REPLACE THIS URL with your actual Hugging Face Space URL!
|
| 44 |
+
const API_URL = "https://amn23-car-image-classification.hf.space/detect"
|
| 45 |
|
| 46 |
const uploadArea = document.getElementById('upload-area');
|
| 47 |
const imageUpload = document.getElementById('image-upload');
|