xiaoyao9184 commited on
Commit
dfeb7aa
·
verified ·
1 Parent(s): 799ef2a

Synced repo using 'sync_with_huggingface' Github Action

Browse files

original:
- remote: "https://github.com/xiaoyao9184/docker-wam"
- commit: "5534577bbaa3e3cf573e7a79604d19efbaedd350"
sync_with_huggingface:
- repository: ""
- ref: ""

Files changed (1) hide show
  1. gradio_app.py +14 -1
gradio_app.py CHANGED
@@ -20,6 +20,8 @@ if "SPACE_ID" in os.environ:
20
  if '__main__' == __name__:
21
 
22
  import gradio as gr
 
 
23
 
24
  import os
25
  import re
@@ -152,6 +154,10 @@ if '__main__' == __name__:
152
  - Union[str, float, bool, list, dict]: Metadata or messages related to the detection.
153
  - str: A markdown string summarizing the detection result (e.g., confidence level).
154
  """
 
 
 
 
155
  if image is None:
156
  return None, None, None, {"status": "error", "messages": [], "error": "No image provided"}
157
 
@@ -233,6 +239,10 @@ if '__main__' == __name__:
233
  - dict: Image showing the watermark position (shown in "Position of the watermark").
234
  - Union[str, float, bool, list, dict]: Metadata or message related to the embedding process (shown in "Marked Messages").
235
  """
 
 
 
 
236
  if image is None:
237
  return None, None, {
238
  "status": "failure",
@@ -364,7 +374,10 @@ if '__main__' == __name__:
364
  # Watermark Anything Demo
365
  ![](https://badge.mcpx.dev?type=server 'MCP Server')
366
  This app demonstrates watermark detection and embedding using the Watermark Anything model.
367
- Find the project [here](https://github.com/facebookresearch/watermark-anything).
 
 
 
368
  """)
369
 
370
  with gr.Tabs():
 
20
  if '__main__' == __name__:
21
 
22
  import gradio as gr
23
+ import requests
24
+ from contextlib import suppress
25
 
26
  import os
27
  import re
 
154
  - Union[str, float, bool, list, dict]: Metadata or messages related to the detection.
155
  - str: A markdown string summarizing the detection result (e.g., confidence level).
156
  """
157
+ # update counter
158
+ with suppress(Exception):
159
+ requests.get("https://counterapi.com/api/xiaoyao9184.github.com/view/docker-wam")
160
+
161
  if image is None:
162
  return None, None, None, {"status": "error", "messages": [], "error": "No image provided"}
163
 
 
239
  - dict: Image showing the watermark position (shown in "Position of the watermark").
240
  - Union[str, float, bool, list, dict]: Metadata or message related to the embedding process (shown in "Marked Messages").
241
  """
242
+ # update counter
243
+ with suppress(Exception):
244
+ requests.get("https://counterapi.com/api/xiaoyao9184.github.com/view/docker-wam")
245
+
246
  if image is None:
247
  return None, None, {
248
  "status": "failure",
 
374
  # Watermark Anything Demo
375
  ![](https://badge.mcpx.dev?type=server 'MCP Server')
376
  This app demonstrates watermark detection and embedding using the Watermark Anything model.
377
+
378
+ Find the original project [here](https://github.com/facebookresearch/watermark-anything).
379
+ Or this project [here](https://github.com/xiaoyao9184/docker-wam).
380
+ See the [README](./blob/main/README.md) for Spaces's metadata.
381
  """)
382
 
383
  with gr.Tabs():