kmeans_iou: K-means clustering of 2-d data with IoU distance

Description Usage Arguments Value

View source: R/core.R

Description

Allows to cluster 2-dimensional with k-means using intersection over union distance. This is useful for anchors initialization in the YOLO-family of models for object detection. See Redmon et al. (2016) <arXiv:1612.08242>, Redmon et al. (2016) <arXiv:1804.02767>.

Usage

1
2
kmeans_iou(x, k, iter = 10, init = x[sample(nrow(x), size = k), , drop
  = FALSE], early_stop = 3L, verbose = FALSE)

Arguments

x

input 2-d matrix: first column is wisth, second column is height of the bounding box

k

number of clusters

iter

number of k-means iterations

init

2-d matrix of initial centroids. Should have k rows

early_stop

integer - stop k-means if there is no improvement during last early_stop iterations

verbose

logical, whether to print information during fitting the model

Value

list of 2 values. First is a matrix of cluster centers, second is cluster membership indices.


dselivanov/kmeansiou documentation built on Feb. 13, 2020, 10:46 a.m.