Spaces:
Paused
Paused
Update CatVTON/model/pipeline.py
Browse files
CatVTON/model/pipeline.py
CHANGED
|
@@ -206,7 +206,7 @@ class CatVTONPipeline:
|
|
| 206 |
if not self.skip_safety_check:
|
| 207 |
current_script_directory = os.path.dirname(os.path.realpath(__file__))
|
| 208 |
nsfw_image = os.path.join(os.path.dirname(current_script_directory), 'resource', 'img', 'NSFW.jpg')
|
| 209 |
-
nsfw_image = PIL.Image.open(
|
| 210 |
image_np = np.array(image)
|
| 211 |
_, has_nsfw_concept = self.run_safety_checker(image=image_np)
|
| 212 |
for i, not_safe in enumerate(has_nsfw_concept):
|
|
@@ -323,7 +323,7 @@ class CatVTONPix2PixPipeline(CatVTONPipeline):
|
|
| 323 |
if not self.skip_safety_check:
|
| 324 |
current_script_directory = os.path.dirname(os.path.realpath(__file__))
|
| 325 |
nsfw_image = os.path.join(os.path.dirname(current_script_directory), 'resource', 'img', 'NSFW.jpg')
|
| 326 |
-
nsfw_image = PIL.Image.open(
|
| 327 |
image_np = np.array(image)
|
| 328 |
_, has_nsfw_concept = self.run_safety_checker(image=image_np)
|
| 329 |
for i, not_safe in enumerate(has_nsfw_concept):
|
|
|
|
| 206 |
if not self.skip_safety_check:
|
| 207 |
current_script_directory = os.path.dirname(os.path.realpath(__file__))
|
| 208 |
nsfw_image = os.path.join(os.path.dirname(current_script_directory), 'resource', 'img', 'NSFW.jpg')
|
| 209 |
+
nsfw_image = PIL.Image.open("/tmp/NSFW.jpg").resize(image[0].size)
|
| 210 |
image_np = np.array(image)
|
| 211 |
_, has_nsfw_concept = self.run_safety_checker(image=image_np)
|
| 212 |
for i, not_safe in enumerate(has_nsfw_concept):
|
|
|
|
| 323 |
if not self.skip_safety_check:
|
| 324 |
current_script_directory = os.path.dirname(os.path.realpath(__file__))
|
| 325 |
nsfw_image = os.path.join(os.path.dirname(current_script_directory), 'resource', 'img', 'NSFW.jpg')
|
| 326 |
+
nsfw_image = PIL.Image.open("/tmp/NSFW.jpg").resize(image[0].size)
|
| 327 |
image_np = np.array(image)
|
| 328 |
_, has_nsfw_concept = self.run_safety_checker(image=image_np)
|
| 329 |
for i, not_safe in enumerate(has_nsfw_concept):
|