Fahimeh Orvati Nia commited on
Commit
731e4a7
·
1 Parent(s): 8a6669e
Files changed (1) hide show
  1. sorghum_pipeline/pipeline.py +6 -8
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
- # Load image
56
- img = Image.open(single_image_path)
57
- arr = np.array(img)
58
- print("Debug: Uploaded image shape: ", arr.shape)
59
  plants = {
60
  "demo": {
61
- "raw_image": (img, Path(single_image_path).name),
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
  }