mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-05-10 17:38:32 +00:00
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
19 lines
358 B
Python
19 lines
358 B
Python
import cv2
|
|
import fire
|
|
from imwatermark import WatermarkDecoder
|
|
|
|
|
|
def testit(img_path):
|
|
bgr = cv2.imread(img_path)
|
|
decoder = WatermarkDecoder("bytes", 136)
|
|
watermark = decoder.decode(bgr, "dwtDct")
|
|
try:
|
|
dec = watermark.decode("utf-8")
|
|
except:
|
|
dec = "null"
|
|
print(dec)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
fire.Fire(testit)
|