Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ learner = from_pretrained_fastai(repo_id)
|
|
8 |
|
9 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
10 |
def predict(img):
|
11 |
-
img = PIL.Image.open(
|
12 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(size),tfms.A.Normalize()])
|
13 |
pred_dict = models.ross.efficientdet.end2end_detect(img, infer_tfms, model.to("cpu"), class_map=class_map, detection_threshold=0.5)
|
14 |
return pred_dict["img"]
|
|
|
8 |
|
9 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
10 |
def predict(img):
|
11 |
+
img = PIL.Image.open(img)
|
12 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(size),tfms.A.Normalize()])
|
13 |
pred_dict = models.ross.efficientdet.end2end_detect(img, infer_tfms, model.to("cpu"), class_map=class_map, detection_threshold=0.5)
|
14 |
return pred_dict["img"]
|