Skip to content

Instantly share code, notes, and snippets.

@mithi
Last active Jan 20, 2021
Embed
What would you like to do?
feature_params = {
'color_model': 'yuv', # hls, hsv, yuv, ycrcb
'bounding_box_size': 64, # 64 pixels x 64 pixel image
'number_of_orientations': 11, # 6 - 12
'pixels_per_cell': 16, # 8, 16
'cells_per_block': 2, # 1, 2
'do_transform_sqrt': True
}
src = FeatureSourcer(feature_params, temp_frame)
cls = BinaryClassifier(svc, scaler)
slider = Slider(sourcer = src, classifier = cls, increment = 8)
this_heatmap = HeatMap(frame = temp_frame, thresh = 30, memory = 40)
window_sizes = 80, 120, 150, 180
strip_positions = 410, 390, 380, 380
def pipeline(this_frame):
for sz, pos in zip(window_sizes, strip_positions):
bounding_boxes = slider.locate(frame = this_frame, window_size = sz, window_position = pos)
this_heatmap.update(bounding_boxes)
heatmap, thresholded_map, labeled_map = this_heatmap.get()
labeled_frame = this_heatmap.draw(this_frame)
return labeled_frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment