feylur commited on
Commit
8ec79fc
·
verified ·
1 Parent(s): fad41db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -36,6 +36,12 @@ def load_models():
36
 
37
  print(f"✅ Models downloaded to: {repo_path}")
38
 
 
 
 
 
 
 
39
  print("Initializing pipeline...")
40
  pipeline = CatVTONPipeline(
41
  base_ckpt="booksforcharlie/stable-diffusion-inpainting",
@@ -48,12 +54,6 @@ def load_models():
48
  print("✅ Pipeline loaded!")
49
 
50
  print("Initializing automasker...")
51
-
52
- # Force CPU for DensePose config
53
- import sys
54
- sys.path.insert(0, os.path.join(repo_path, "DensePose"))
55
- from detectron2.config import get_cfg
56
-
57
  automasker = AutoMasker(
58
  densepose_ckpt=os.path.join(repo_path, "DensePose"),
59
  schp_ckpt=os.path.join(repo_path, "SCHP"),
 
36
 
37
  print(f"✅ Models downloaded to: {repo_path}")
38
 
39
+ # Create NSFW placeholder
40
+ nsfw_path = "/app/CatVTON/resource/img/NSFW.jpg"
41
+ os.makedirs(os.path.dirname(nsfw_path), exist_ok=True)
42
+ if not os.path.exists(nsfw_path):
43
+ Image.new('RGB', (512, 512), color='black').save(nsfw_path)
44
+
45
  print("Initializing pipeline...")
46
  pipeline = CatVTONPipeline(
47
  base_ckpt="booksforcharlie/stable-diffusion-inpainting",
 
54
  print("✅ Pipeline loaded!")
55
 
56
  print("Initializing automasker...")
 
 
 
 
 
 
57
  automasker = AutoMasker(
58
  densepose_ckpt=os.path.join(repo_path, "DensePose"),
59
  schp_ckpt=os.path.join(repo_path, "SCHP"),