Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions invokeai/backend/image_util/imwatermark/vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
# `opencv-contrib-python`. It's easier to copy the code over than complicate the installation process by
# requiring an extra post-install step of removing `opencv-python` and installing `opencv-contrib-python`.

import base64
import struct
import uuid
import base64

import cv2
import numpy as np
import pywt
Expand Down Expand Up @@ -111,8 +112,8 @@ def __init__(self, wm_type="bytes", length=0):
raise NameError("%s is unsupported" % wm_type)

def reconstruct_ipv4(self, bits):
ips = [str(ip) for ip in list(np.packbits(bits))]
return ".".join(ips)
arr = np.packbits(bits)
return ".".join(map(str, arr.tolist()))

def reconstruct_uuid(self, bits):
nums = np.packbits(bits)
Expand Down