(dataset, k=0)
| 185 | |
| 186 | |
| 187 | def create_aspect_ratio_groups(dataset, k=0): |
| 188 | aspect_ratios = compute_aspect_ratios(dataset) |
| 189 | bins = (2 ** np.linspace(-1, 1, 2 * k + 1)).tolist() if k > 0 else [1.0] |
| 190 | groups = _quantize(aspect_ratios, bins) |
| 191 | # count number of elements per group |
| 192 | counts = np.unique(groups, return_counts=True)[1] |
| 193 | fbins = [0] + bins + [np.inf] |
| 194 | print(f"Using {fbins} as bins for aspect ratio quantization") |
| 195 | print(f"Count of instances per bin: {counts}") |
| 196 | return groups |
no test coverage detected
searching dependent graphs…