Humboldt commited on
Commit
44338f2
·
1 Parent(s): d624153

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -84,6 +84,7 @@ if file_str:
84
  start_x = geo_tiff.get_wgs_84_coords(0, 0)[0]
85
  start_y = geo_tiff.get_wgs_84_coords(i, j)[1]
86
 
 
87
  print(start_x, start_y)
88
  print(deg_pixel_x,deg_pixel_y )
89
  print('_'*50 + ' Ende '+ '_'*50)
@@ -94,7 +95,7 @@ if file_str:
94
  deg_pixel_x*size+size*deg_pixel_x, start_y+int(j/size/2)*deg_pixel_y*size+size*deg_pixel_y)]
95
 
96
  array = geo_tiff.read_box(area_box.copy())
97
-
98
 
99
  size=(416, 416)
100
 
@@ -102,8 +103,8 @@ if file_str:
102
  with Image.open(file) as im:
103
  im.thumbnail(size)
104
 
105
- #gloabl_image = c2.image(im)
106
- gloabl_image = c2.image(array/255)
107
 
108
  threshold = c2.text_input(
109
  label='Detection threshold: Reduce to detect more trees, increase to remove duplicates', value=0.05)
@@ -190,10 +191,12 @@ if file_str:
190
  t1 = time.time()
191
  boxes, scores, classes, nums = yolo.predict(img_in, verbose=False)
192
 
 
193
  print('image min max:', img.min(), img.max(), img.shape)
194
 
195
  images.append(img.astype('float')/255)
196
  imgg.image(images, width=230)
 
197
 
198
  if nums > 0:
199
 
@@ -215,8 +218,8 @@ if file_str:
215
  img = cv2.putText(img, "Time: {:.2f}ms".format(sum(times)/len(times)*1000), (0, 30),
216
  cv2.FONT_HERSHEY_COMPLEX_SMALL, 1, (0, 0, 255), 2)
217
 
218
- #images.append(img)
219
- #imgg.image(images, width=230)
220
 
221
  for ind in range(nums[0]):
222
  classes_found.append(class_names[int(classes[0][ind])])
 
84
  start_x = geo_tiff.get_wgs_84_coords(0, 0)[0]
85
  start_y = geo_tiff.get_wgs_84_coords(i, j)[1]
86
 
87
+ '''
88
  print(start_x, start_y)
89
  print(deg_pixel_x,deg_pixel_y )
90
  print('_'*50 + ' Ende '+ '_'*50)
 
95
  deg_pixel_x*size+size*deg_pixel_x, start_y+int(j/size/2)*deg_pixel_y*size+size*deg_pixel_y)]
96
 
97
  array = geo_tiff.read_box(area_box.copy())
98
+ '''
99
 
100
  size=(416, 416)
101
 
 
103
  with Image.open(file) as im:
104
  im.thumbnail(size)
105
 
106
+ gloabl_image = c2.image(im)
107
+ #gloabl_image = c2.image(array/255)
108
 
109
  threshold = c2.text_input(
110
  label='Detection threshold: Reduce to detect more trees, increase to remove duplicates', value=0.05)
 
191
  t1 = time.time()
192
  boxes, scores, classes, nums = yolo.predict(img_in, verbose=False)
193
 
194
+ '''
195
  print('image min max:', img.min(), img.max(), img.shape)
196
 
197
  images.append(img.astype('float')/255)
198
  imgg.image(images, width=230)
199
+ '''
200
 
201
  if nums > 0:
202
 
 
218
  img = cv2.putText(img, "Time: {:.2f}ms".format(sum(times)/len(times)*1000), (0, 30),
219
  cv2.FONT_HERSHEY_COMPLEX_SMALL, 1, (0, 0, 255), 2)
220
 
221
+ images.append(img/255)
222
+ imgg.image(images, width=230)
223
 
224
  for ind in range(nums[0]):
225
  classes_found.append(class_names[int(classes[0][ind])])