-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.27 KB
/
python-engine.yml
File metadata and controls
83 lines (73 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: test all
on: [push, pull_request]
permissions:
contents: read
jobs:
python-smoke:
runs-on: ubuntu-latest
name: Test robust watermark engine
defaults:
run:
working-directory: blind_watermark
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Smoke test - import and roundtrip
shell: python {0}
env:
PYTHONPATH: .
run: |
from rwm_engine import embed_watermark, extract_watermark, check_dependencies
import numpy as np
dep = check_dependencies()
assert dep['ok'], f'Missing deps: {dep}'
img = np.random.randint(0, 256, (800, 800, 3), dtype=np.uint8)
embedded = embed_watermark(
img,
'hello world',
password=42,
quality='balanced',
)
assert embedded['ok'], f'Embed failed: {embedded}'
assert embedded['image'] is not None, f'Embed image missing: {embedded}'
assert embedded['engine_used'] in {'legacy', 'neural'}, embedded
extracted = extract_watermark(
embedded['image'],
password=42,
quality='balanced',
)
assert extracted['ok'], f'Extract failed: {extracted}'
assert extracted['wm'] == 'hello world', f'Roundtrip failed: {extracted}'
print('All tests passed.')
mlwm-unit-tests:
runs-on: ubuntu-latest
name: MLWM unit tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r blind_watermark/requirements.txt
- name: Run MLWM unit tests
run: |
python -m unittest discover -s blind_watermark/tests
typecheck:
runs-on: ubuntu-latest
name: Typecheck
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: npm
- name: Install dependencies
run: npm ci
- name: Run TypeScript checks
run: npm run typecheck