Spaces:
Build error
Build error
Update colorization.py
Browse files- colorization.py +4 -4
colorization.py
CHANGED
|
@@ -57,15 +57,15 @@ def inferenceColorize(img, version, scale):
|
|
| 57 |
else:
|
| 58 |
extension = 'jpg'
|
| 59 |
'''
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
|
| 64 |
'''
|
| 65 |
cv2.imwrite(save_path, output)
|
| 66 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
| 67 |
'''
|
| 68 |
-
|
| 69 |
'''
|
| 70 |
except Exception as error:
|
| 71 |
print('global exception', error)
|
|
|
|
| 57 |
else:
|
| 58 |
extension = 'jpg'
|
| 59 |
'''
|
| 60 |
+
os.makedirs('output', exist_ok=True)
|
| 61 |
+
model.predict(img.name)
|
| 62 |
+
save_path = f'output/DeOldify/'+Path(img.name).stem+'.{extension}'
|
| 63 |
|
| 64 |
'''
|
| 65 |
cv2.imwrite(save_path, output)
|
| 66 |
output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
| 67 |
'''
|
| 68 |
+
return img, save_path
|
| 69 |
'''
|
| 70 |
except Exception as error:
|
| 71 |
print('global exception', error)
|