Fahimeh Orvati Nia
commited on
Commit
·
731e4a7
1
Parent(s):
8a6669e
sorghum_pipeline/pipeline.py
CHANGED
|
@@ -46,19 +46,17 @@ class SorghumPipeline:
|
|
| 46 |
def run(self, single_image_path: str) -> Dict[str, Any]:
|
| 47 |
"""Run pipeline on single image."""
|
| 48 |
logger.info("Processing single image...")
|
| 49 |
-
|
| 50 |
-
from PIL import Image
|
| 51 |
import time
|
| 52 |
-
|
|
|
|
| 53 |
start = time.perf_counter()
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
arr
|
| 58 |
-
print("Debug: Uploaded image shape: ", arr.shape)
|
| 59 |
plants = {
|
| 60 |
"demo": {
|
| 61 |
-
"raw_image": (
|
| 62 |
"plant_name": "demo",
|
| 63 |
}
|
| 64 |
}
|
|
|
|
| 46 |
def run(self, single_image_path: str) -> Dict[str, Any]:
|
| 47 |
"""Run pipeline on single image."""
|
| 48 |
logger.info("Processing single image...")
|
|
|
|
|
|
|
| 49 |
import time
|
| 50 |
+
import cv2
|
| 51 |
+
|
| 52 |
start = time.perf_counter()
|
| 53 |
|
| 54 |
+
|
| 55 |
+
arr = cv2.imread(single_image_path, cv2.IMREAD_UNCHANGED)
|
| 56 |
+
print("Debug: Uploaded image shape: ", arr.shape, arr.dtype) # (1024, 1024), uint16
|
|
|
|
| 57 |
plants = {
|
| 58 |
"demo": {
|
| 59 |
+
"raw_image": (arr, Path(single_image_path).name),
|
| 60 |
"plant_name": "demo",
|
| 61 |
}
|
| 62 |
}
|