VideoChain-API / src /production /renderSegmentation.mts
jbilcke-hf's picture
jbilcke-hf HF staff
refactoring
8aa943e
raw
history blame
594 Bytes
import { RenderedScene, RenderRequest } from "../types.mts"
import { renderImageSegmentation } from "./renderImageSegmentation.mts"
import { renderVideoSegmentation } from "./renderVideoSegmentation.mts"
export async function renderSegmentation(request: RenderRequest, response: RenderedScene) {
if (request.segmentation === "firstframe" || request.segmentation === "allframes") {
const isVideo = request?.nbFrames > 1
const renderSegmentationFn = isVideo
? renderVideoSegmentation
: renderImageSegmentation
await renderSegmentationFn(request, response)
}
}