Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,14 @@ class_names = ['Glass', 'Metal', 'Paperboard', 'Plastic-Polystyrene', 'Plastic-R
|
|
| 14 |
# Create FastAPI app
|
| 15 |
app = FastAPI()
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Preprocessing the image (resize, normalize, etc.)
|
| 18 |
def preprocess_image(image_file):
|
| 19 |
image = Image.open(image_file)
|
|
|
|
| 14 |
# Create FastAPI app
|
| 15 |
app = FastAPI()
|
| 16 |
|
| 17 |
+
app.add_middleware(
|
| 18 |
+
CORSMiddleware,
|
| 19 |
+
allow_origins=["https://recyclesmart.vercel.app"], # or use ["*"] for all origins (not recommended for production)
|
| 20 |
+
allow_credentials=True,
|
| 21 |
+
allow_methods=["*"],
|
| 22 |
+
allow_headers=["*"],
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
# Preprocessing the image (resize, normalize, etc.)
|
| 26 |
def preprocess_image(image_file):
|
| 27 |
image = Image.open(image_file)
|