Skip to content

Commit

Permalink
Merge pull request #7 from LdDl/mleak
Browse files Browse the repository at this point in the history
Closes #6
  • Loading branch information
LdDl authored May 15, 2020
2 parents 8105b8f + 527e294 commit 420a747
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions network.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ struct network_box_result perform_network_detect(network *n, image *img, int cla
sized = resize_image(*img, n->w, n->h);
}
struct network_box_result result = { NULL };
float *X = sized.data;
network_predict(*n, X);
network_predict_ptr(n, sized.data);
int nboxes = 0;
detection *dets = get_network_boxes(n, img->w, img->h, thresh, hier_thresh, 0, 1, &nboxes, letter_box);
result.detections = get_network_boxes(n, img->w, img->h, thresh, hier_thresh, 0, 1, &result.detections_len, letter_box);
if (nms) {
do_nms_sort(result.detections, result.detections_len, classes, nms);
Expand Down
1 change: 0 additions & 1 deletion network.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (n *YOLONetwork) Detect(img *DarknetImage) (*DetectionResult, error) {
startTime := time.Now()
result := C.perform_network_detect(n.cNet, &img.image, C.int(n.Classes), C.float(n.Threshold), C.float(n.hierarchalThreshold), C.float(n.nms), C.int(0))
endTime := time.Now()
// defer C.free_detections(result.detections, result.detections_len)
ds := makeDetections(img, result.detections, int(result.detections_len), n.Threshold, n.Classes, n.ClassNames)
C.free_detections(result.detections, result.detections_len)
endTimeOverall := time.Now()
Expand Down

0 comments on commit 420a747

Please sign in to comment.