|
from imwatermark import WatermarkDecoder |
|
import gradio as gr |
|
|
|
|
|
|
|
WATERMARK_MESSAGE = 0b101100111110110010010000011110111011000110011110 |
|
|
|
WATERMARK_BITS = [int(bit) for bit in bin(WATERMARK_MESSAGE)[2:]] |
|
|
|
def detect_watermark(image): |
|
decoder = WatermarkDecoder('bytes', 32) |
|
watermark = decoder.decode(image, 'dwtDct') |
|
print(watermark.decode()) |
|
return "ไฝใใใใใพใใใงใใใ" |
|
|
|
gr.Interface(fn=detect_watermark, |
|
title="AI็ปๅ็ฐกๆใใงใใฏใใผใซ", |
|
description="ๆๅฎใฎ็ปๅใ็ปๅ็ๆAIใซใใฃใฆไฝใใใใใฎใใ็ฐกๆ็ใซๅคๅฎใใพใใใใฎใใผใซใงๅคๅฎใใใใจใๆฑบใใฆๆญๅฎ็ใซ็จใใชใใงใใ ใใใ", |
|
inputs=gr.Image(type="numpy"), |
|
outputs=gr.Textbox()).launch() |