Update server.py
Browse files
server.py
CHANGED
|
@@ -55,7 +55,7 @@ print(f"β Image transform defined (size: {CONFIG['image_size']}x{CONFIG['image
|
|
| 55 |
def preprocess_image(image_path: str) -> torch.Tensor:
|
| 56 |
"""Load and preprocess image."""
|
| 57 |
image = Image.open(image_path).convert('RGB')
|
| 58 |
-
return transform(image)
|
| 59 |
|
| 60 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 61 |
# ARCHITECTURE 1 β CoAtNet Encoder (shared by all three models)
|
|
|
|
| 55 |
def preprocess_image(image_path: str) -> torch.Tensor:
|
| 56 |
"""Load and preprocess image."""
|
| 57 |
image = Image.open(image_path).convert('RGB')
|
| 58 |
+
return transform(image).unsqueeze(0) # Add batch dimension
|
| 59 |
|
| 60 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 61 |
# ARCHITECTURE 1 β CoAtNet Encoder (shared by all three models)
|