@uug-ai/models 1.7.125 → 1.7.127

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,169 @@
1
+ {
2
+ "description": "Where a redaction region is drawn, frame by frame. Every implementation of the rule (RedactionRegion.BoxAt in Go, the editor's preview in TypeScript) runs these cases. A region is drawn on a frame when it is enabled, the frame is within start..end, and the frame is in no hidden range (all bounds inclusive). Its box is the keyframe on that frame; between two keyframes a and b each coordinate is a + (b - a) * (frame - a.frame) / (b.frame - a.frame); before the first keyframe it is the first keyframe's box, after the last keyframe the last one's. Each expectation gives a frame and either the box as [x1, y1, x2, y2] or null when the region is not drawn. Compare coordinates with a tolerance of 1e-9.",
3
+ "cases": [
4
+ {
5
+ "name": "a single keyframe is a static region over its time range",
6
+ "region": {
7
+ "id": "static", "origin": "manual", "shape": "rectangle", "style": { "mode": "black" },
8
+ "enabled": true, "start": 10, "end": 20,
9
+ "keyframes": [{ "frame": 10, "x1": 0.5, "y1": 0.25, "x2": 0.75, "y2": 0.5 }]
10
+ },
11
+ "expect": [
12
+ { "frame": 9, "box": null },
13
+ { "frame": 10, "box": [0.5, 0.25, 0.75, 0.5] },
14
+ { "frame": 15, "box": [0.5, 0.25, 0.75, 0.5] },
15
+ { "frame": 20, "box": [0.5, 0.25, 0.75, 0.5] },
16
+ { "frame": 21, "box": null }
17
+ ]
18
+ },
19
+ {
20
+ "name": "each coordinate is interpolated linearly between two keyframes",
21
+ "region": {
22
+ "id": "moving", "origin": "detected", "shape": "rectangle", "style": { "mode": "blur" },
23
+ "enabled": true, "start": 0, "end": 8,
24
+ "keyframes": [
25
+ { "frame": 0, "x1": 0, "y1": 0, "x2": 0.25, "y2": 0.5 },
26
+ { "frame": 8, "x1": 0.5, "y1": 0.25, "x2": 1, "y2": 1 }
27
+ ]
28
+ },
29
+ "expect": [
30
+ { "frame": 0, "box": [0, 0, 0.25, 0.5] },
31
+ { "frame": 2, "box": [0.125, 0.0625, 0.4375, 0.625] },
32
+ { "frame": 4, "box": [0.25, 0.125, 0.625, 0.75] },
33
+ { "frame": 8, "box": [0.5, 0.25, 1, 1] }
34
+ ]
35
+ },
36
+ {
37
+ "name": "the segment between the two surrounding keyframes is used",
38
+ "region": {
39
+ "id": "three", "origin": "detected", "shape": "rectangle", "style": { "mode": "pixelate" },
40
+ "enabled": true, "start": 0, "end": 12,
41
+ "keyframes": [
42
+ { "frame": 0, "x1": 0, "y1": 0, "x2": 0.5, "y2": 0.5 },
43
+ { "frame": 4, "x1": 0.5, "y1": 0, "x2": 1, "y2": 0.5 },
44
+ { "frame": 12, "x1": 0.5, "y1": 0.5, "x2": 1, "y2": 1 }
45
+ ]
46
+ },
47
+ "expect": [
48
+ { "frame": 2, "box": [0.25, 0, 0.75, 0.5] },
49
+ { "frame": 4, "box": [0.5, 0, 1, 0.5] },
50
+ { "frame": 8, "box": [0.5, 0.25, 1, 0.75] },
51
+ { "frame": 12, "box": [0.5, 0.5, 1, 1] }
52
+ ]
53
+ },
54
+ {
55
+ "name": "the first box is held before the first keyframe and the last box after the last keyframe",
56
+ "region": {
57
+ "id": "held", "origin": "manual", "shape": "rectangle", "style": { "mode": "blur" },
58
+ "enabled": true, "start": 0, "end": 30,
59
+ "keyframes": [
60
+ { "frame": 10, "x1": 0, "y1": 0, "x2": 0.5, "y2": 0.5 },
61
+ { "frame": 20, "x1": 0.5, "y1": 0.5, "x2": 1, "y2": 1 }
62
+ ]
63
+ },
64
+ "expect": [
65
+ { "frame": 0, "box": [0, 0, 0.5, 0.5] },
66
+ { "frame": 9, "box": [0, 0, 0.5, 0.5] },
67
+ { "frame": 15, "box": [0.25, 0.25, 0.75, 0.75] },
68
+ { "frame": 21, "box": [0.5, 0.5, 1, 1] },
69
+ { "frame": 30, "box": [0.5, 0.5, 1, 1] }
70
+ ]
71
+ },
72
+ {
73
+ "name": "keyframes outside the time range still anchor the interpolation",
74
+ "region": {
75
+ "id": "trimmed", "origin": "detected", "shape": "rectangle", "style": { "mode": "blur" },
76
+ "enabled": true, "start": 4, "end": 6,
77
+ "keyframes": [
78
+ { "frame": 0, "x1": 0, "y1": 0, "x2": 0.25, "y2": 0.25 },
79
+ { "frame": 8, "x1": 0.5, "y1": 0.5, "x2": 0.75, "y2": 0.75 }
80
+ ]
81
+ },
82
+ "expect": [
83
+ { "frame": 0, "box": null },
84
+ { "frame": 3, "box": null },
85
+ { "frame": 4, "box": [0.25, 0.25, 0.5, 0.5] },
86
+ { "frame": 6, "box": [0.375, 0.375, 0.625, 0.625] },
87
+ { "frame": 7, "box": null },
88
+ { "frame": 8, "box": null }
89
+ ]
90
+ },
91
+ {
92
+ "name": "a hidden range hides both of its ends and nothing around them",
93
+ "region": {
94
+ "id": "hidden", "origin": "detected", "shape": "rectangle", "style": { "mode": "blur" },
95
+ "enabled": true, "start": 0, "end": 10,
96
+ "hidden": [{ "from": 3, "to": 5 }, { "from": 8, "to": 8 }],
97
+ "keyframes": [{ "frame": 0, "x1": 0.25, "y1": 0.25, "x2": 0.5, "y2": 0.5 }]
98
+ },
99
+ "expect": [
100
+ { "frame": 2, "box": [0.25, 0.25, 0.5, 0.5] },
101
+ { "frame": 3, "box": null },
102
+ { "frame": 4, "box": null },
103
+ { "frame": 5, "box": null },
104
+ { "frame": 6, "box": [0.25, 0.25, 0.5, 0.5] },
105
+ { "frame": 7, "box": [0.25, 0.25, 0.5, 0.5] },
106
+ { "frame": 8, "box": null },
107
+ { "frame": 9, "box": [0.25, 0.25, 0.5, 0.5] }
108
+ ]
109
+ },
110
+ {
111
+ "name": "a keyframe on a hidden frame is not drawn but still anchors the interpolation",
112
+ "region": {
113
+ "id": "hidden-keyframe", "origin": "detected", "shape": "rectangle", "style": { "mode": "blur" },
114
+ "enabled": true, "start": 0, "end": 8,
115
+ "hidden": [{ "from": 4, "to": 4 }],
116
+ "keyframes": [
117
+ { "frame": 0, "x1": 0, "y1": 0, "x2": 0.25, "y2": 0.25 },
118
+ { "frame": 4, "x1": 0.5, "y1": 0.5, "x2": 0.75, "y2": 0.75 },
119
+ { "frame": 8, "x1": 0, "y1": 0, "x2": 0.25, "y2": 0.25 }
120
+ ]
121
+ },
122
+ "expect": [
123
+ { "frame": 2, "box": [0.25, 0.25, 0.5, 0.5] },
124
+ { "frame": 4, "box": null },
125
+ { "frame": 6, "box": [0.25, 0.25, 0.5, 0.5] }
126
+ ]
127
+ },
128
+ {
129
+ "name": "overlapping and unsorted hidden ranges are all applied",
130
+ "region": {
131
+ "id": "overlap", "origin": "manual", "shape": "rectangle", "style": { "mode": "black" },
132
+ "enabled": true, "start": 0, "end": 10,
133
+ "hidden": [{ "from": 6, "to": 9 }, { "from": 0, "to": 4 }, { "from": 3, "to": 7 }],
134
+ "keyframes": [{ "frame": 0, "x1": 0, "y1": 0, "x2": 1, "y2": 1 }]
135
+ },
136
+ "expect": [
137
+ { "frame": 0, "box": null },
138
+ { "frame": 5, "box": null },
139
+ { "frame": 9, "box": null },
140
+ { "frame": 10, "box": [0, 0, 1, 1] }
141
+ ]
142
+ },
143
+ {
144
+ "name": "a disabled region is never drawn",
145
+ "region": {
146
+ "id": "disabled", "origin": "detected", "shape": "rectangle", "style": { "mode": "blur" },
147
+ "enabled": false, "start": 0, "end": 10,
148
+ "keyframes": [{ "frame": 0, "x1": 0.25, "y1": 0.25, "x2": 0.5, "y2": 0.5 }]
149
+ },
150
+ "expect": [
151
+ { "frame": 0, "box": null },
152
+ { "frame": 5, "box": null }
153
+ ]
154
+ },
155
+ {
156
+ "name": "a time range of one frame draws that frame only",
157
+ "region": {
158
+ "id": "one-frame", "origin": "manual", "shape": "rectangle", "style": { "mode": "blur" },
159
+ "enabled": true, "start": 7, "end": 7,
160
+ "keyframes": [{ "frame": 7, "x1": 0.25, "y1": 0.25, "x2": 0.5, "y2": 0.5 }]
161
+ },
162
+ "expect": [
163
+ { "frame": 6, "box": null },
164
+ { "frame": 7, "box": [0.25, 0.25, 0.5, 0.5] },
165
+ { "frame": 8, "box": null }
166
+ ]
167
+ }
168
+ ]
169
+ }