jonathan-roos commited on
Commit
c6f57a1
1 Parent(s): 5049919

added model.pkl

Browse files
Files changed (2) hide show
  1. detector.py +1 -11
  2. model.pkl +3 -0
detector.py CHANGED
@@ -52,21 +52,11 @@ def crop_bat(img, box):
52
  bat_crop = img[crop_x1: crop_x2, crop_y1: crop_y2]
53
 
54
  return bat_crop
55
-
56
- def find_bats(allImgs):
57
- batDepthMin, batDepthMax = 50, 400
58
- cropped_bats = []
59
-
60
- for img in allImgs:
61
- blobs = cv.findContours(img[1], cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)[-2]
62
- cropped_bats.extend([crop_bat(img[0], np.int0(cv.boxPoints(cv.minAreaRect(blob)))) for blob in blobs if batDepthMin < cv.contourArea(blob) < batDepthMax])
63
-
64
- return cropped_bats
65
 
66
  def find_bats(allImgs):
67
  total_bats, batDepthMin,batDepthMax = 0, 50, 400
68
  allImgAfter = []
69
- learn = load_learner("model_densenet_zeros.pkl")
70
 
71
  for img in allImgs:
72
  blobs = cv.findContours(img[1], cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)[-2]
 
52
  bat_crop = img[crop_x1: crop_x2, crop_y1: crop_y2]
53
 
54
  return bat_crop
 
 
 
 
 
 
 
 
 
 
55
 
56
  def find_bats(allImgs):
57
  total_bats, batDepthMin,batDepthMax = 0, 50, 400
58
  allImgAfter = []
59
+ learn = load_learner("model.pkl")
60
 
61
  for img in allImgs:
62
  blobs = cv.findContours(img[1], cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)[-2]
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a698e2165ecc0b8ecbc238d7ea72c250023cf6af034b31a7108e04268656bbe0
3
+ size 102895971