Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -22,7 +22,7 @@ from tensorflow.keras.models import Model
|
|
22 |
from tensorflow.keras.preprocessing.image import img_to_array
|
23 |
from sklearn.metrics.pairwise import cosine_similarity
|
24 |
|
25 |
-
BASE_DIR = "
|
26 |
app = FastAPI()
|
27 |
mobilenet = MobileNetV2(weights="imagenet", include_top=False, pooling='avg')
|
28 |
|
@@ -114,10 +114,6 @@ def load_image(source, frame_time=1):
|
|
114 |
os.remove(temp_video_path)
|
115 |
return frame
|
116 |
|
117 |
-
app = FastAPI()
|
118 |
-
|
119 |
-
BASE_DIR = "/tmp/data"
|
120 |
-
|
121 |
@app.post("/save")
|
122 |
async def save(image_data: RequestModel):
|
123 |
os.makedirs(BASE_DIR, exist_ok=True)
|
|
|
22 |
from tensorflow.keras.preprocessing.image import img_to_array
|
23 |
from sklearn.metrics.pairwise import cosine_similarity
|
24 |
|
25 |
+
BASE_DIR = "/tmp/data"
|
26 |
app = FastAPI()
|
27 |
mobilenet = MobileNetV2(weights="imagenet", include_top=False, pooling='avg')
|
28 |
|
|
|
114 |
os.remove(temp_video_path)
|
115 |
return frame
|
116 |
|
|
|
|
|
|
|
|
|
117 |
@app.post("/save")
|
118 |
async def save(image_data: RequestModel):
|
119 |
os.makedirs(BASE_DIR, exist_ok=True)
|