computes a soft mask of a class of image content, using a neural network, no
clicks needed. channel chooses what to select: people, sky, vegetation,
water, mountain, ground (natural: soil, sand, snow, rock), building, the main
subject of the photo, artificial ground (roads, pavement, floors, railways,
sports fields) or clothing. invert selects everything else, e.g. the
background when used with subject. use the mask as the mask input of a
blend module, refined by a guided filter.
the segment-sky preset shows how.
the weights are read from ~/.config/vkdt/data/segment-*.dat, one file per
network: nseg for nvidia, aseg for amd, iseg for intel gpus with 8x16x16
cooperative matrices and gseg for everything else, arch overrides the
choice. without weights the mask is empty.
you can download the weights package here.
arch which network to run: auto picks by gpu vendorchannel what the mask selectsinvert select everything elsehard blend from the soft mask to a hard one, shrunk to sit inside the
selection, for a guided filter to grow back to the edges in the imageshrink how far to shrink the hard mask, relative to the image widthinput scene-referred linear rec2020output the maskthe network was trained from scratch on openly licensed images only: the subset of COCO-Stuff whose images are CC BY, CC BY-SA or have no known copyright restrictions, and the segmentation masks of Open Images V7 (annotations CC BY 4.0, images CC BY 2.0). no pretrained weights were used and no images are distributed. the subject channel is learned from the largest, most central object of the COCO images. Open Images point labels (e.g. sky, tree, road) add sparse supervision.
the spir-v is generated using denox and vkdt-denox.