Spaces:
Paused
Paused
Update app.py
Browse files31 unmodified lines32333435363711 unmodified lines49505152535421 unmodified lines767778798081352 unmodified lines43443543643731 unmodified linesuser_dir = os.path.join(TMP_DIR, str(req.session_hash))shutil.rmtree(user_dir)def preprocess_image(image: Image.Image) -> Image.Image:"""Preprocess the input image for 3D generation.11 unmodified linesprocessed_image = pipeline.preprocess_image(image)return processed_imagedef preprocess_videos(video: str) -> List[Tuple[Image.Image, str]]:"""Preprocess the input video for multi-image 3D generation.21 unmodified linesprocessed_images = [pipeline.preprocess_image(image) for image in images]return processed_imagesdef preprocess_images(images: List[Tuple[Image.Image, str]]) -> List[Image.Image]:"""Preprocess a list of input images for multi-image 3D generation.352 unmodified linespipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-1")pipeline.cuda()pipeline.VGGT_model.cuda()demo.launch()31 unmodified lines3233343536373811 unmodified lines5051525354555621 unmodified lines78798081828384352 unmodified lines43743843944044131 unmodified linesuser_dir = os.path.join(TMP_DIR, str(req.session_hash))shutil.rmtree(user_dir)@spaces.GPUdef preprocess_image(image: Image.Image) -> Image.Image:"""Preprocess the input image for 3D generation.11 unmodified linesprocessed_image = pipeline.preprocess_image(image)return processed_image@spaces.GPUdef preprocess_videos(video: str) -> List[Tuple[Image.Image, str]]:"""Preprocess the input video for multi-image 3D generation.21 unmodified linesprocessed_images = [pipeline.preprocess_image(image) for image in images]return processed_images@spaces.GPUdef preprocess_images(images: List[Tuple[Image.Image, str]]) -> List[Image.Image]:"""Preprocess a list of input images for multi-image 3D generation.352 unmodified linespipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-1")pipeline.cuda()pipeline.VGGT_model.cuda()pipeline.birefnet_model.cuda()demo.launch()
app.py+4