mirror of
				https://github.com/swdee/go-rknnlite.git
				synced 2025-11-01 03:02:57 +08:00 
			
		
		
		
	remove unused code/functions
This commit is contained in:
		| @@ -350,17 +350,3 @@ func minInt(nums ...int) int { | |||||||
|  |  | ||||||
| 	return min | 	return min | ||||||
| } | } | ||||||
|  |  | ||||||
| // maxInt finds the max value in a slice of integers |  | ||||||
| func maxInt(nums ...int) int { |  | ||||||
|  |  | ||||||
| 	max := nums[0] |  | ||||||
|  |  | ||||||
| 	for _, v := range nums { |  | ||||||
| 		if v > max { |  | ||||||
| 			max = v |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return max |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -116,8 +116,6 @@ type Demo struct { | |||||||
| 	process YOLOProcessor | 	process YOLOProcessor | ||||||
| 	// labels are the COCO labels the YOLO model was trained on | 	// labels are the COCO labels the YOLO model was trained on | ||||||
| 	labels []string | 	labels []string | ||||||
| 	// inputAttrs are the model tensor input attributes |  | ||||||
| 	inputAttrs []rknnlite.TensorAttr |  | ||||||
| 	// limitObjs restricts object detection results to be only those provided | 	// limitObjs restricts object detection results to be only those provided | ||||||
| 	limitObjs []string | 	limitObjs []string | ||||||
| 	// resizer handles scaling of source image to input tensors | 	// resizer handles scaling of source image to input tensors | ||||||
|   | |||||||
| @@ -275,16 +275,6 @@ func resizeByOpenCVUint8(inputImage []uint8, inputWidth, inputHeight, boxesNum i | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| func intInSlice(i int, arr []int) bool { |  | ||||||
| 	for _, next := range arr { |  | ||||||
| 		if i == next { |  | ||||||
| 			return true |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return false |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // boxReverse scales detection box back to box for use on original image dimensions | // boxReverse scales detection box back to box for use on original image dimensions | ||||||
| func boxReverse(pos int, pad int, scale float32) int { | func boxReverse(pos int, pad int, scale float32) int { | ||||||
| 	return int(float32(pos-pad) / scale) | 	return int(float32(pos-pad) / scale) | ||||||
|   | |||||||
| @@ -286,16 +286,6 @@ func (y *YOLOv5Seg) DetectObjects(outputs *rknnlite.Outputs, | |||||||
| 	return res | 	return res | ||||||
| } | } | ||||||
|  |  | ||||||
| func int64InSlice(i int64, arr []int64) bool { |  | ||||||
| 	for _, next := range arr { |  | ||||||
| 		if i == next { |  | ||||||
| 			return true |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return false |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // SegmentMask creates segment mask data for object detection results | // SegmentMask creates segment mask data for object detection results | ||||||
| func (y *YOLOv5Seg) SegmentMask(detectObjs DetectionResult, | func (y *YOLOv5Seg) SegmentMask(detectObjs DetectionResult, | ||||||
| 	resizer *preprocess.Resizer) SegMask { | 	resizer *preprocess.Resizer) SegMask { | ||||||
|   | |||||||
| @@ -69,18 +69,7 @@ func findTopPoint(approx gocv.PointVector) image.Point { | |||||||
| 	return topPoint | 	return topPoint | ||||||
| } | } | ||||||
|  |  | ||||||
| // isContourInsideBoxRect checks if the bounding box of a contour fits | // isContourInsideTrackerRect checks if the bounding box of a contour fits | ||||||
| // inside the bounding box of the detection result plus a pad |  | ||||||
| func isContourInsideBoxRect(contourRect image.Rectangle, |  | ||||||
| 	bbox postprocess.BoxRect, pad int) bool { |  | ||||||
|  |  | ||||||
| 	return contourRect.Min.X >= bbox.Left-pad && |  | ||||||
| 		contourRect.Min.Y >= bbox.Top-pad && |  | ||||||
| 		contourRect.Max.X <= bbox.Right+pad && |  | ||||||
| 		contourRect.Max.Y <= bbox.Bottom+pad |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // isContourInsideBoxRect checks if the bounding box of a contour fits |  | ||||||
| // inside the bounding box of the detection result plus a pad | // inside the bounding box of the detection result plus a pad | ||||||
| func isContourInsideTrackerRect(contourRect image.Rectangle, | func isContourInsideTrackerRect(contourRect image.Rectangle, | ||||||
| 	bbox *tracker.Rect, pad int) bool { | 	bbox *tracker.Rect, pad int) bool { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 swdee
					swdee