Spaces:
Runtime error
Runtime error
Commit
·
ef36e61
1
Parent(s):
82faf11
Update vtoonify_model.py
Browse files- vtoonify_model.py +3 -3
vtoonify_model.py
CHANGED
|
@@ -217,13 +217,13 @@ class Model():
|
|
| 217 |
|
| 218 |
def video_tooniy(self, aligned_video: str, instyle: torch.Tensor, exstyle: torch.Tensor, style_degree: float) -> tuple[str, str]:
|
| 219 |
if aligned_video is None:
|
| 220 |
-
return '
|
| 221 |
video_cap = cv2.VideoCapture(aligned_video)
|
| 222 |
if instyle is None or aligned_face is None or video_cap.get(7) == 0:
|
| 223 |
video_cap.release()
|
| 224 |
-
return '
|
| 225 |
if exstyle is None:
|
| 226 |
-
return '
|
| 227 |
num = min(300, int(video_cap.get(7)))
|
| 228 |
if self.device == 'cpu':
|
| 229 |
num = min(100, num)
|
|
|
|
| 217 |
|
| 218 |
def video_tooniy(self, aligned_video: str, instyle: torch.Tensor, exstyle: torch.Tensor, style_degree: float) -> tuple[str, str]:
|
| 219 |
if aligned_video is None:
|
| 220 |
+
return 'default.mp4', 'Opps, something wrong with the input. Please go to Step 2 and Rescale Video again.'
|
| 221 |
video_cap = cv2.VideoCapture(aligned_video)
|
| 222 |
if instyle is None or aligned_face is None or video_cap.get(7) == 0:
|
| 223 |
video_cap.release()
|
| 224 |
+
return 'default.mp4', 'Opps, something wrong with the input. Please go to Step 2 and Rescale Video again.'
|
| 225 |
if exstyle is None:
|
| 226 |
+
return 'default.mp4', 'Opps, something wrong with the style type. Please go to Step 1 and load model again.'
|
| 227 |
num = min(300, int(video_cap.get(7)))
|
| 228 |
if self.device == 'cpu':
|
| 229 |
num = min(100, num)
|