Skip to content
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,10 @@ def detect_hog(self, image):
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
rects, weights = self.hog.detectMultiScale(gray, winStride=(4, 4),
padding=(8, 8), scale=1.05)

bboxes = []
scores = []
for (x, y, w, h) in rects:
# 过滤掉太小的检测
if w > 50 and h > 50:
bboxes.append([x, y, x+w, y+h])
scores.append(1.0) # HOG不返回置信度分数


# 使用列表推导式简化过滤和转换
bboxes = [[x, y, x + w, y + h] for (x, y, w, h) in rects if w > 50 and h > 50]
scores = [1.0] * len(bboxes) # HOG不返回置信度分数
return np.array(bboxes), np.array(scores)

def detect_yolo(self, image):
Expand Down
Loading