Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -42,6 +42,7 @@ app = FastAPI()
|
|
| 42 |
# Define the path to your "static" directory
|
| 43 |
static_path = Path(__file__).resolve().parent / "static"
|
| 44 |
|
|
|
|
| 45 |
# Route to serve files dynamically based on the filename parameter
|
| 46 |
@app.get("/{filename:path}")
|
| 47 |
async def serve_file(filename: str):
|
|
@@ -57,7 +58,7 @@ async def serve_file(filename: str):
|
|
| 57 |
|
| 58 |
@app.post("/detectImage")
|
| 59 |
async def detect_image(file: UploadFile):
|
| 60 |
-
|
| 61 |
# Load your image using OpenCV
|
| 62 |
image_data = await file.read()
|
| 63 |
image_np = np.frombuffer(image_data, np.uint8)
|
|
|
|
| 42 |
# Define the path to your "static" directory
|
| 43 |
static_path = Path(__file__).resolve().parent / "static"
|
| 44 |
|
| 45 |
+
model_pipe = get_yolov5(0.6)
|
| 46 |
# Route to serve files dynamically based on the filename parameter
|
| 47 |
@app.get("/{filename:path}")
|
| 48 |
async def serve_file(filename: str):
|
|
|
|
| 58 |
|
| 59 |
@app.post("/detectImage")
|
| 60 |
async def detect_image(file: UploadFile):
|
| 61 |
+
|
| 62 |
# Load your image using OpenCV
|
| 63 |
image_data = await file.read()
|
| 64 |
image_np = np.frombuffer(image_data, np.uint8)
|