remove unused code/functions

This commit is contained in:
swdee
2025-04-20 15:16:58 +12:00
parent 895770b239
commit 18bc88f956
5 changed files with 1 additions and 48 deletions

View File

@@ -350,17 +350,3 @@ func minInt(nums ...int) int {
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
}

View File

@@ -116,8 +116,6 @@ type Demo struct {
process YOLOProcessor
// labels are the COCO labels the YOLO model was trained on
labels []string
// inputAttrs are the model tensor input attributes
inputAttrs []rknnlite.TensorAttr
// limitObjs restricts object detection results to be only those provided
limitObjs []string
// resizer handles scaling of source image to input tensors

View File

@@ -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
func boxReverse(pos int, pad int, scale float32) int {
return int(float32(pos-pad) / scale)

View File

@@ -286,16 +286,6 @@ func (y *YOLOv5Seg) DetectObjects(outputs *rknnlite.Outputs,
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
func (y *YOLOv5Seg) SegmentMask(detectObjs DetectionResult,
resizer *preprocess.Resizer) SegMask {

View File

@@ -69,18 +69,7 @@ func findTopPoint(approx gocv.PointVector) image.Point {
return topPoint
}
// isContourInsideBoxRect 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
// isContourInsideTrackerRect checks if the bounding box of a contour fits
// inside the bounding box of the detection result plus a pad
func isContourInsideTrackerRect(contourRect image.Rectangle,
bbox *tracker.Rect, pad int) bool {