Spaces:
Sleeping
Sleeping
Commit
·
959cf76
1
Parent(s):
799e434
Update model.py
Browse files
model.py
CHANGED
@@ -78,7 +78,7 @@ class Model(LabelStudioMLBase):
|
|
78 |
if self.id2label[label.item()] == 'Propuesta':
|
79 |
pred_label_id = str(uuid4())
|
80 |
image = image.crop((x.item(), y.item(), x2.item(), y2.item()))
|
81 |
-
|
82 |
logits = self.seg_model(**inputs).logits
|
83 |
logits = torch.exp(logits)
|
84 |
preds = logits > 0.5
|
|
|
78 |
if self.id2label[label.item()] == 'Propuesta':
|
79 |
pred_label_id = str(uuid4())
|
80 |
image = image.crop((x.item(), y.item(), x2.item(), y2.item()))
|
81 |
+
inputs = self.seg_image_processor(images=image, return_tensors="pt")
|
82 |
logits = self.seg_model(**inputs).logits
|
83 |
logits = torch.exp(logits)
|
84 |
preds = logits > 0.5
|