skills/cv/gaussian-sphere-target-generation/SKILL.md
Generates 3D segmentation training targets by placing Gaussian spheres at annotated point coordinates.
npx skillsauth add wenmin-wu/ds-skills cv-gaussian-sphere-target-generationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When ground truth is point annotations (x, y, z) rather than voxel masks, generate training targets by placing 3D Gaussian blobs at each annotated location. Each particle type gets its own channel with a configurable radius. The model learns to predict these soft targets, and centroids are recovered at inference via peak detection or connected components.
import numpy as np
def generate_gaussian_volume(shape, coords, sigma=3.0):
volume = np.zeros(shape, dtype=np.float32)
for z, y, x in coords:
zz, yy, xx = np.ogrid[
max(0,int(z)-3*int(sigma)):min(shape[0],int(z)+3*int(sigma)+1),
max(0,int(y)-3*int(sigma)):min(shape[1],int(y)+3*int(sigma)+1),
max(0,int(x)-3*int(sigma)):min(shape[2],int(x)+3*int(sigma)+1),
]
d2 = (zz-z)**2 + (yy-y)**2 + (xx-x)**2
volume[zz, yy, xx] = np.maximum(volume[zz, yy, xx], np.exp(-d2/(2*sigma**2)))
return volume
np.maximum to handle overlapping particles (keep brightest value)max prevents double-counting overlapping particles; sum better for density estimationdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF