ReyaLabColumbia commited on
Commit
e48ee35
·
verified ·
1 Parent(s): 1476a35

Upload Colony_Analyzer_AI_zstack2_HF.py

Browse files
Files changed (1) hide show
  1. Colony_Analyzer_AI_zstack2_HF.py +4 -4
Colony_Analyzer_AI_zstack2_HF.py CHANGED
@@ -271,10 +271,10 @@ def main(args):
271
  img = np.array(files[0])
272
  if img.ndim == 2:
273
  img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
274
- caption = np.ones((150, 2048, 3), dtype=np.uint8) * 255 # Multiply by 255 to make it white
275
- cv2.putText(caption, 'No colonies detected.', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 3)
276
- cv2.imwrite('results.png', np.vstack(img, caption)))
277
- colonies = pd.DataFrame({"Colony Number":[], 'Colony volume':[], "colony_area":[],'mean_pixel_value':[], "centroid":[], "necrotic_area":[],"percent_necrotic":[]})
278
  with pd.ExcelWriter('results.xlsx') as writer:
279
  colonies.to_excel(writer, sheet_name="Colony data", index=False)
280
  return(np.vstack((img, caption)), 'results.png', 'results.xlsx')
 
271
  img = np.array(files[0])
272
  if img.ndim == 2:
273
  img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
274
+ caption = np.ones((150, 2048, 3), dtype=np.uint8) * 255 # Multiply by 255 to make it white
275
+ cv2.putText(caption, 'No colonies detected.', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 3)
276
+ cv2.imwrite('results.png', np.vstack(img, caption)))
277
+ colonies = pd.DataFrame({"Colony Number":[], 'Colony volume':[], "colony_area":[],'mean_pixel_value':[], "centroid":[], "necrotic_area":[],"percent_necrotic":[]})
278
  with pd.ExcelWriter('results.xlsx') as writer:
279
  colonies.to_excel(writer, sheet_name="Colony data", index=False)
280
  return(np.vstack((img, caption)), 'results.png', 'results.xlsx')