Skip to content

Commit

Permalink
output in png
Browse files Browse the repository at this point in the history
  • Loading branch information
lqhl committed Oct 5, 2023
1 parent 5ca1078 commit edcf6bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cog_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ def predict(
print('Error', error)
print('If you encounter CUDA out of memory, try to set "tile" to a smaller size, e.g., 400.')

if img_mode == 'RGBA': # RGBA images should be saved in png format
extension = 'png'
# save_path = f'output/out.{extension}'
# cv2.imwrite(save_path, output)
out_path = Path(tempfile.mkdtemp()) / f'out.{extension}'
out_path = Path(tempfile.mkdtemp()) / f'out.png'
cv2.imwrite(str(out_path), output)
except Exception as error:
print('global exception: ', error)
Expand Down

0 comments on commit edcf6bc

Please sign in to comment.