🔥 Fix NumPy compatibility + processor padding
Browse files
app/__pycache__/inference.cpython-310.pyc
CHANGED
|
Binary files a/app/__pycache__/inference.cpython-310.pyc and b/app/__pycache__/inference.cpython-310.pyc differ
|
|
|
app/__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/app/__pycache__/main.cpython-310.pyc and b/app/__pycache__/main.cpython-310.pyc differ
|
|
|
app/__pycache__/model.cpython-310.pyc
CHANGED
|
Binary files a/app/__pycache__/model.cpython-310.pyc and b/app/__pycache__/model.cpython-310.pyc differ
|
|
|
app/inference.py
CHANGED
|
@@ -161,7 +161,7 @@ def classify_bytes(image_bytes: bytes):
|
|
| 161 |
|
| 162 |
# Load and preprocess image
|
| 163 |
image = Image.open(io.BytesIO(image_bytes)).convert("RGB")
|
| 164 |
-
inputs = processor(images=image, return_tensors="pt").to(DEVICE)
|
| 165 |
|
| 166 |
# Forward pass
|
| 167 |
with torch.no_grad():
|
|
|
|
| 161 |
|
| 162 |
# Load and preprocess image
|
| 163 |
image = Image.open(io.BytesIO(image_bytes)).convert("RGB")
|
| 164 |
+
inputs = processor(images=image, return_tensors="pt", padding="True").to(DEVICE)
|
| 165 |
|
| 166 |
# Forward pass
|
| 167 |
with torch.no_grad():
|