Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import io
|
|
9 |
import base64
|
10 |
|
11 |
app = Flask(__name__)
|
12 |
-
modelName = "yolov9c-seg"
|
13 |
-
model = YOLO(modelName
|
14 |
|
15 |
|
16 |
@app.route("/")
|
@@ -34,17 +34,16 @@ def processor():
|
|
34 |
modelNameForm = request.form.get("model", modelName)
|
35 |
if modelNameForm != modelName:
|
36 |
modelName = modelNameForm
|
37 |
-
model = YOLO(modelName
|
38 |
image = image.split(",")[1]
|
39 |
image = base64.b64decode(image)
|
40 |
image = Image.open(io.BytesIO(image))
|
41 |
image = np.array(image)
|
42 |
results = model(
|
43 |
image,
|
44 |
-
task="segment",
|
45 |
show=False,
|
46 |
save=False,
|
47 |
-
show_boxes=
|
48 |
show_labels=True,
|
49 |
imgsz=640,
|
50 |
iou=0.1,
|
|
|
9 |
import base64
|
10 |
|
11 |
app = Flask(__name__)
|
12 |
+
modelName = "yolov9c-seg.pt"
|
13 |
+
model = YOLO(modelName)
|
14 |
|
15 |
|
16 |
@app.route("/")
|
|
|
34 |
modelNameForm = request.form.get("model", modelName)
|
35 |
if modelNameForm != modelName:
|
36 |
modelName = modelNameForm
|
37 |
+
model = YOLO(modelName)
|
38 |
image = image.split(",")[1]
|
39 |
image = base64.b64decode(image)
|
40 |
image = Image.open(io.BytesIO(image))
|
41 |
image = np.array(image)
|
42 |
results = model(
|
43 |
image,
|
|
|
44 |
show=False,
|
45 |
save=False,
|
46 |
+
show_boxes=True,
|
47 |
show_labels=True,
|
48 |
imgsz=640,
|
49 |
iou=0.1,
|