winrt-Windows.Media.FaceAnalysis 2.0.0b1__tar.gz
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.
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/PKG-INFO +22 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/README.md +7 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/all-requirements.txt +6 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/py.Windows.Media.FaceAnalysis.cpp +861 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/pyproject.toml +43 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/pywinrt-version.txt +1 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/requirements.txt +3 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/setup.cfg +4 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/setup.py +17 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt/_winrt_windows_media_faceanalysis.pyi +67 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt/windows/media/faceanalysis/__init__.py +14 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/PKG-INFO +22 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/SOURCES.txt +14 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/dependency_links.txt +1 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/requires.txt +7 -0
- winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: winrt-Windows.Media.FaceAnalysis
|
|
3
|
+
Version: 2.0.0b1
|
|
4
|
+
Summary: Python projection of Windows Runtime (WinRT) APIs
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/pywrint/pywrinrt
|
|
7
|
+
Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Requires-Python: <3.13,>=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Provides-Extra: all
|
|
15
|
+
|
|
16
|
+
<!-- warning: Please don't edit this file. It was automatically generated. -->
|
|
17
|
+
|
|
18
|
+
# winrt-Windows.Media.FaceAnalysis
|
|
19
|
+
|
|
20
|
+
Windows Runtime (WinRT) APIs for for the `Windows.Media.FaceAnalysis` namespace.
|
|
21
|
+
|
|
22
|
+
This package provides the `winrt.windows.media.faceanalysis` module.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!-- warning: Please don't edit this file. It was automatically generated. -->
|
|
2
|
+
|
|
3
|
+
# winrt-Windows.Media.FaceAnalysis
|
|
4
|
+
|
|
5
|
+
Windows Runtime (WinRT) APIs for for the `Windows.Media.FaceAnalysis` namespace.
|
|
6
|
+
|
|
7
|
+
This package provides the `winrt.windows.media.faceanalysis` module.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
|
|
2
|
+
|
|
3
|
+
winrt-Windows.Foundation[all]==2.0.0-beta.1
|
|
4
|
+
winrt-Windows.Foundation.Collections[all]==2.0.0-beta.1
|
|
5
|
+
winrt-Windows.Graphics.Imaging[all]==2.0.0-beta.1
|
|
6
|
+
winrt-Windows.Media[all]==2.0.0-beta.1
|
|
@@ -0,0 +1,861 @@
|
|
|
1
|
+
// WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
|
|
2
|
+
|
|
3
|
+
#include "py.Windows.Media.FaceAnalysis.h"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
namespace py::cpp::Windows::Media::FaceAnalysis
|
|
7
|
+
{
|
|
8
|
+
// ----- DetectedFace class --------------------
|
|
9
|
+
|
|
10
|
+
static PyObject* _new_DetectedFace(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
|
|
11
|
+
{
|
|
12
|
+
static_assert(py::py_type<winrt::Windows::Media::FaceAnalysis::DetectedFace>::type_name);
|
|
13
|
+
py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::FaceAnalysis::DetectedFace>::type_name);
|
|
14
|
+
return nullptr;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static void _dealloc_DetectedFace(py::wrapper::Windows::Media::FaceAnalysis::DetectedFace* self) noexcept
|
|
18
|
+
{
|
|
19
|
+
auto tp = Py_TYPE(self);
|
|
20
|
+
std::destroy_at(&self->obj);
|
|
21
|
+
tp->tp_free(self);
|
|
22
|
+
Py_DECREF(tp);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static PyObject* DetectedFace_get_FaceBox(py::wrapper::Windows::Media::FaceAnalysis::DetectedFace* self, void* /*unused*/) noexcept
|
|
26
|
+
{
|
|
27
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.DetectedFace", L"FaceBox"))
|
|
28
|
+
{
|
|
29
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
30
|
+
return nullptr;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try
|
|
34
|
+
{
|
|
35
|
+
return py::convert(self->obj.FaceBox());
|
|
36
|
+
}
|
|
37
|
+
catch (...)
|
|
38
|
+
{
|
|
39
|
+
py::to_PyErr();
|
|
40
|
+
return nullptr;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static PyObject* _assign_array_DetectedFace(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
45
|
+
{
|
|
46
|
+
auto array = std::make_unique<py::ComArray<winrt::Windows::Media::FaceAnalysis::DetectedFace>>();
|
|
47
|
+
if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
|
|
48
|
+
{
|
|
49
|
+
return nullptr;
|
|
50
|
+
}
|
|
51
|
+
Py_RETURN_NONE;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static PyObject* _from_DetectedFace(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
55
|
+
{
|
|
56
|
+
try
|
|
57
|
+
{
|
|
58
|
+
auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
|
|
59
|
+
return py::convert(return_value.as<winrt::Windows::Media::FaceAnalysis::DetectedFace>());
|
|
60
|
+
}
|
|
61
|
+
catch (...)
|
|
62
|
+
{
|
|
63
|
+
py::to_PyErr();
|
|
64
|
+
return nullptr;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static PyMethodDef _methods_DetectedFace[] = {
|
|
69
|
+
{ "_assign_array_", _assign_array_DetectedFace, METH_O | METH_STATIC, nullptr },
|
|
70
|
+
{ "_from", reinterpret_cast<PyCFunction>(_from_DetectedFace), METH_O | METH_STATIC, nullptr },
|
|
71
|
+
{ }
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
static PyGetSetDef _getset_DetectedFace[] = {
|
|
75
|
+
{ "face_box", reinterpret_cast<getter>(DetectedFace_get_FaceBox), nullptr, nullptr, nullptr },
|
|
76
|
+
{ }
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
static PyType_Slot _type_slots_DetectedFace[] =
|
|
80
|
+
{
|
|
81
|
+
{ Py_tp_new, reinterpret_cast<void*>(_new_DetectedFace) },
|
|
82
|
+
{ Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DetectedFace) },
|
|
83
|
+
{ Py_tp_methods, reinterpret_cast<void*>(_methods_DetectedFace) },
|
|
84
|
+
{ Py_tp_getset, reinterpret_cast<void*>(_getset_DetectedFace) },
|
|
85
|
+
{ },
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
static PyType_Spec type_spec_DetectedFace =
|
|
89
|
+
{
|
|
90
|
+
"winrt._winrt_windows_media_faceanalysis.DetectedFace",
|
|
91
|
+
sizeof(py::wrapper::Windows::Media::FaceAnalysis::DetectedFace),
|
|
92
|
+
0,
|
|
93
|
+
Py_TPFLAGS_DEFAULT,
|
|
94
|
+
_type_slots_DetectedFace
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// ----- FaceDetector class --------------------
|
|
98
|
+
|
|
99
|
+
static PyObject* _new_FaceDetector(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
|
|
100
|
+
{
|
|
101
|
+
static_assert(py::py_type<winrt::Windows::Media::FaceAnalysis::FaceDetector>::type_name);
|
|
102
|
+
py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::FaceAnalysis::FaceDetector>::type_name);
|
|
103
|
+
return nullptr;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static void _dealloc_FaceDetector(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self) noexcept
|
|
107
|
+
{
|
|
108
|
+
auto tp = Py_TYPE(self);
|
|
109
|
+
std::destroy_at(&self->obj);
|
|
110
|
+
tp->tp_free(self);
|
|
111
|
+
Py_DECREF(tp);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static PyObject* FaceDetector_CreateAsync(PyObject* /*unused*/, PyObject* args) noexcept
|
|
115
|
+
{
|
|
116
|
+
auto arg_count = PyTuple_Size(args);
|
|
117
|
+
|
|
118
|
+
if (arg_count == 0)
|
|
119
|
+
{
|
|
120
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"CreateAsync", 0))
|
|
121
|
+
{
|
|
122
|
+
py::set_arg_count_version_error(0);
|
|
123
|
+
return nullptr;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
try
|
|
127
|
+
{
|
|
128
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceDetector::CreateAsync());
|
|
129
|
+
}
|
|
130
|
+
catch (...)
|
|
131
|
+
{
|
|
132
|
+
py::to_PyErr();
|
|
133
|
+
return nullptr;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else
|
|
137
|
+
{
|
|
138
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
139
|
+
return nullptr;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static PyObject* FaceDetector_DetectFacesAsync(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self, PyObject* args) noexcept
|
|
144
|
+
{
|
|
145
|
+
auto arg_count = PyTuple_Size(args);
|
|
146
|
+
|
|
147
|
+
if (arg_count == 1)
|
|
148
|
+
{
|
|
149
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"DetectFacesAsync", 1))
|
|
150
|
+
{
|
|
151
|
+
py::set_arg_count_version_error(1);
|
|
152
|
+
return nullptr;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
try
|
|
156
|
+
{
|
|
157
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);
|
|
158
|
+
|
|
159
|
+
return py::convert(self->obj.DetectFacesAsync(param0));
|
|
160
|
+
}
|
|
161
|
+
catch (...)
|
|
162
|
+
{
|
|
163
|
+
py::to_PyErr();
|
|
164
|
+
return nullptr;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else if (arg_count == 2)
|
|
168
|
+
{
|
|
169
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"DetectFacesAsync", 2))
|
|
170
|
+
{
|
|
171
|
+
py::set_arg_count_version_error(2);
|
|
172
|
+
return nullptr;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
try
|
|
176
|
+
{
|
|
177
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);
|
|
178
|
+
auto param1 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapBounds>(args, 1);
|
|
179
|
+
|
|
180
|
+
return py::convert(self->obj.DetectFacesAsync(param0, param1));
|
|
181
|
+
}
|
|
182
|
+
catch (...)
|
|
183
|
+
{
|
|
184
|
+
py::to_PyErr();
|
|
185
|
+
return nullptr;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else
|
|
189
|
+
{
|
|
190
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
191
|
+
return nullptr;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
static PyObject* FaceDetector_GetSupportedBitmapPixelFormats(PyObject* /*unused*/, PyObject* args) noexcept
|
|
196
|
+
{
|
|
197
|
+
auto arg_count = PyTuple_Size(args);
|
|
198
|
+
|
|
199
|
+
if (arg_count == 0)
|
|
200
|
+
{
|
|
201
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"GetSupportedBitmapPixelFormats", 0))
|
|
202
|
+
{
|
|
203
|
+
py::set_arg_count_version_error(0);
|
|
204
|
+
return nullptr;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
try
|
|
208
|
+
{
|
|
209
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceDetector::GetSupportedBitmapPixelFormats());
|
|
210
|
+
}
|
|
211
|
+
catch (...)
|
|
212
|
+
{
|
|
213
|
+
py::to_PyErr();
|
|
214
|
+
return nullptr;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else
|
|
218
|
+
{
|
|
219
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
220
|
+
return nullptr;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
static PyObject* FaceDetector_IsBitmapPixelFormatSupported(PyObject* /*unused*/, PyObject* args) noexcept
|
|
225
|
+
{
|
|
226
|
+
auto arg_count = PyTuple_Size(args);
|
|
227
|
+
|
|
228
|
+
if (arg_count == 1)
|
|
229
|
+
{
|
|
230
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"IsBitmapPixelFormatSupported", 1))
|
|
231
|
+
{
|
|
232
|
+
py::set_arg_count_version_error(1);
|
|
233
|
+
return nullptr;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
try
|
|
237
|
+
{
|
|
238
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapPixelFormat>(args, 0);
|
|
239
|
+
|
|
240
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceDetector::IsBitmapPixelFormatSupported(param0));
|
|
241
|
+
}
|
|
242
|
+
catch (...)
|
|
243
|
+
{
|
|
244
|
+
py::to_PyErr();
|
|
245
|
+
return nullptr;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
else
|
|
249
|
+
{
|
|
250
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
251
|
+
return nullptr;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
static PyObject* FaceDetector_get_MinDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self, void* /*unused*/) noexcept
|
|
256
|
+
{
|
|
257
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"MinDetectableFaceSize"))
|
|
258
|
+
{
|
|
259
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
260
|
+
return nullptr;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
try
|
|
264
|
+
{
|
|
265
|
+
return py::convert(self->obj.MinDetectableFaceSize());
|
|
266
|
+
}
|
|
267
|
+
catch (...)
|
|
268
|
+
{
|
|
269
|
+
py::to_PyErr();
|
|
270
|
+
return nullptr;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
static int FaceDetector_put_MinDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self, PyObject* arg, void* /*unused*/) noexcept
|
|
275
|
+
{
|
|
276
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"MinDetectableFaceSize"))
|
|
277
|
+
{
|
|
278
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
279
|
+
return -1;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (arg == nullptr)
|
|
283
|
+
{
|
|
284
|
+
PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
|
|
285
|
+
return -1;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
try
|
|
289
|
+
{
|
|
290
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapSize>(arg);
|
|
291
|
+
|
|
292
|
+
self->obj.MinDetectableFaceSize(param0);
|
|
293
|
+
return 0;
|
|
294
|
+
}
|
|
295
|
+
catch (...)
|
|
296
|
+
{
|
|
297
|
+
py::to_PyErr();
|
|
298
|
+
return -1;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static PyObject* FaceDetector_get_MaxDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self, void* /*unused*/) noexcept
|
|
303
|
+
{
|
|
304
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"MaxDetectableFaceSize"))
|
|
305
|
+
{
|
|
306
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
307
|
+
return nullptr;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
try
|
|
311
|
+
{
|
|
312
|
+
return py::convert(self->obj.MaxDetectableFaceSize());
|
|
313
|
+
}
|
|
314
|
+
catch (...)
|
|
315
|
+
{
|
|
316
|
+
py::to_PyErr();
|
|
317
|
+
return nullptr;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
static int FaceDetector_put_MaxDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector* self, PyObject* arg, void* /*unused*/) noexcept
|
|
322
|
+
{
|
|
323
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"MaxDetectableFaceSize"))
|
|
324
|
+
{
|
|
325
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
326
|
+
return -1;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (arg == nullptr)
|
|
330
|
+
{
|
|
331
|
+
PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
|
|
332
|
+
return -1;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
try
|
|
336
|
+
{
|
|
337
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapSize>(arg);
|
|
338
|
+
|
|
339
|
+
self->obj.MaxDetectableFaceSize(param0);
|
|
340
|
+
return 0;
|
|
341
|
+
}
|
|
342
|
+
catch (...)
|
|
343
|
+
{
|
|
344
|
+
py::to_PyErr();
|
|
345
|
+
return -1;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
static PyObject* FaceDetector_get_IsSupported(PyObject* /*unused*/, void* /*unused*/) noexcept
|
|
350
|
+
{
|
|
351
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceDetector", L"IsSupported"))
|
|
352
|
+
{
|
|
353
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
354
|
+
return nullptr;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
try
|
|
358
|
+
{
|
|
359
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceDetector::IsSupported());
|
|
360
|
+
}
|
|
361
|
+
catch (...)
|
|
362
|
+
{
|
|
363
|
+
py::to_PyErr();
|
|
364
|
+
return nullptr;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static PyObject* _assign_array_FaceDetector(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
369
|
+
{
|
|
370
|
+
auto array = std::make_unique<py::ComArray<winrt::Windows::Media::FaceAnalysis::FaceDetector>>();
|
|
371
|
+
if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
|
|
372
|
+
{
|
|
373
|
+
return nullptr;
|
|
374
|
+
}
|
|
375
|
+
Py_RETURN_NONE;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
static PyObject* _from_FaceDetector(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
379
|
+
{
|
|
380
|
+
try
|
|
381
|
+
{
|
|
382
|
+
auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
|
|
383
|
+
return py::convert(return_value.as<winrt::Windows::Media::FaceAnalysis::FaceDetector>());
|
|
384
|
+
}
|
|
385
|
+
catch (...)
|
|
386
|
+
{
|
|
387
|
+
py::to_PyErr();
|
|
388
|
+
return nullptr;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
static PyMethodDef _methods_FaceDetector[] = {
|
|
393
|
+
{ "detect_faces_async", reinterpret_cast<PyCFunction>(FaceDetector_DetectFacesAsync), METH_VARARGS, nullptr },
|
|
394
|
+
{ "_assign_array_", _assign_array_FaceDetector, METH_O | METH_STATIC, nullptr },
|
|
395
|
+
{ "_from", reinterpret_cast<PyCFunction>(_from_FaceDetector), METH_O | METH_STATIC, nullptr },
|
|
396
|
+
{ }
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
static PyGetSetDef _getset_FaceDetector[] = {
|
|
400
|
+
{ "min_detectable_face_size", reinterpret_cast<getter>(FaceDetector_get_MinDetectableFaceSize), reinterpret_cast<setter>(FaceDetector_put_MinDetectableFaceSize), nullptr, nullptr },
|
|
401
|
+
{ "max_detectable_face_size", reinterpret_cast<getter>(FaceDetector_get_MaxDetectableFaceSize), reinterpret_cast<setter>(FaceDetector_put_MaxDetectableFaceSize), nullptr, nullptr },
|
|
402
|
+
{ }
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
static PyType_Slot _type_slots_FaceDetector[] =
|
|
406
|
+
{
|
|
407
|
+
{ Py_tp_new, reinterpret_cast<void*>(_new_FaceDetector) },
|
|
408
|
+
{ Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FaceDetector) },
|
|
409
|
+
{ Py_tp_methods, reinterpret_cast<void*>(_methods_FaceDetector) },
|
|
410
|
+
{ Py_tp_getset, reinterpret_cast<void*>(_getset_FaceDetector) },
|
|
411
|
+
{ },
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
static PyType_Spec type_spec_FaceDetector =
|
|
415
|
+
{
|
|
416
|
+
"winrt._winrt_windows_media_faceanalysis.FaceDetector",
|
|
417
|
+
sizeof(py::wrapper::Windows::Media::FaceAnalysis::FaceDetector),
|
|
418
|
+
0,
|
|
419
|
+
Py_TPFLAGS_DEFAULT,
|
|
420
|
+
_type_slots_FaceDetector
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
static PyGetSetDef getset_FaceDetector_Static[] = {
|
|
424
|
+
{ "is_supported", reinterpret_cast<getter>(FaceDetector_get_IsSupported), nullptr, nullptr, nullptr },
|
|
425
|
+
{ }
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
static PyMethodDef methods_FaceDetector_Static[] = {
|
|
429
|
+
{ "create_async", reinterpret_cast<PyCFunction>(FaceDetector_CreateAsync), METH_VARARGS, nullptr },
|
|
430
|
+
{ "get_supported_bitmap_pixel_formats", reinterpret_cast<PyCFunction>(FaceDetector_GetSupportedBitmapPixelFormats), METH_VARARGS, nullptr },
|
|
431
|
+
{ "is_bitmap_pixel_format_supported", reinterpret_cast<PyCFunction>(FaceDetector_IsBitmapPixelFormatSupported), METH_VARARGS, nullptr },
|
|
432
|
+
{ }
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
static PyType_Slot type_slots_FaceDetector_Static[] =
|
|
436
|
+
{
|
|
437
|
+
{ Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
|
|
438
|
+
{ Py_tp_getset, reinterpret_cast<void*>(getset_FaceDetector_Static) },
|
|
439
|
+
{ Py_tp_methods, reinterpret_cast<void*>(methods_FaceDetector_Static) },
|
|
440
|
+
{ }
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
static PyType_Spec type_spec_FaceDetector_Static =
|
|
444
|
+
{
|
|
445
|
+
"winrt._winrt_windows_media_faceanalysis.FaceDetector_Static",
|
|
446
|
+
static_cast<int>(PyType_Type.tp_basicsize),
|
|
447
|
+
static_cast<int>(PyType_Type.tp_itemsize),
|
|
448
|
+
Py_TPFLAGS_DEFAULT,
|
|
449
|
+
type_slots_FaceDetector_Static
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// ----- FaceTracker class --------------------
|
|
453
|
+
|
|
454
|
+
static PyObject* _new_FaceTracker(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
|
|
455
|
+
{
|
|
456
|
+
static_assert(py::py_type<winrt::Windows::Media::FaceAnalysis::FaceTracker>::type_name);
|
|
457
|
+
py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::FaceAnalysis::FaceTracker>::type_name);
|
|
458
|
+
return nullptr;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
static void _dealloc_FaceTracker(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self) noexcept
|
|
462
|
+
{
|
|
463
|
+
auto tp = Py_TYPE(self);
|
|
464
|
+
std::destroy_at(&self->obj);
|
|
465
|
+
tp->tp_free(self);
|
|
466
|
+
Py_DECREF(tp);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
static PyObject* FaceTracker_CreateAsync(PyObject* /*unused*/, PyObject* args) noexcept
|
|
470
|
+
{
|
|
471
|
+
auto arg_count = PyTuple_Size(args);
|
|
472
|
+
|
|
473
|
+
if (arg_count == 0)
|
|
474
|
+
{
|
|
475
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"CreateAsync", 0))
|
|
476
|
+
{
|
|
477
|
+
py::set_arg_count_version_error(0);
|
|
478
|
+
return nullptr;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
try
|
|
482
|
+
{
|
|
483
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceTracker::CreateAsync());
|
|
484
|
+
}
|
|
485
|
+
catch (...)
|
|
486
|
+
{
|
|
487
|
+
py::to_PyErr();
|
|
488
|
+
return nullptr;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else
|
|
492
|
+
{
|
|
493
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
494
|
+
return nullptr;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
static PyObject* FaceTracker_GetSupportedBitmapPixelFormats(PyObject* /*unused*/, PyObject* args) noexcept
|
|
499
|
+
{
|
|
500
|
+
auto arg_count = PyTuple_Size(args);
|
|
501
|
+
|
|
502
|
+
if (arg_count == 0)
|
|
503
|
+
{
|
|
504
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"GetSupportedBitmapPixelFormats", 0))
|
|
505
|
+
{
|
|
506
|
+
py::set_arg_count_version_error(0);
|
|
507
|
+
return nullptr;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
try
|
|
511
|
+
{
|
|
512
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceTracker::GetSupportedBitmapPixelFormats());
|
|
513
|
+
}
|
|
514
|
+
catch (...)
|
|
515
|
+
{
|
|
516
|
+
py::to_PyErr();
|
|
517
|
+
return nullptr;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else
|
|
521
|
+
{
|
|
522
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
523
|
+
return nullptr;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
static PyObject* FaceTracker_IsBitmapPixelFormatSupported(PyObject* /*unused*/, PyObject* args) noexcept
|
|
528
|
+
{
|
|
529
|
+
auto arg_count = PyTuple_Size(args);
|
|
530
|
+
|
|
531
|
+
if (arg_count == 1)
|
|
532
|
+
{
|
|
533
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"IsBitmapPixelFormatSupported", 1))
|
|
534
|
+
{
|
|
535
|
+
py::set_arg_count_version_error(1);
|
|
536
|
+
return nullptr;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
try
|
|
540
|
+
{
|
|
541
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapPixelFormat>(args, 0);
|
|
542
|
+
|
|
543
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceTracker::IsBitmapPixelFormatSupported(param0));
|
|
544
|
+
}
|
|
545
|
+
catch (...)
|
|
546
|
+
{
|
|
547
|
+
py::to_PyErr();
|
|
548
|
+
return nullptr;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
else
|
|
552
|
+
{
|
|
553
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
554
|
+
return nullptr;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
static PyObject* FaceTracker_ProcessNextFrameAsync(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self, PyObject* args) noexcept
|
|
559
|
+
{
|
|
560
|
+
auto arg_count = PyTuple_Size(args);
|
|
561
|
+
|
|
562
|
+
if (arg_count == 1)
|
|
563
|
+
{
|
|
564
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"ProcessNextFrameAsync", 1))
|
|
565
|
+
{
|
|
566
|
+
py::set_arg_count_version_error(1);
|
|
567
|
+
return nullptr;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
try
|
|
571
|
+
{
|
|
572
|
+
auto param0 = py::convert_to<winrt::Windows::Media::VideoFrame>(args, 0);
|
|
573
|
+
|
|
574
|
+
return py::convert(self->obj.ProcessNextFrameAsync(param0));
|
|
575
|
+
}
|
|
576
|
+
catch (...)
|
|
577
|
+
{
|
|
578
|
+
py::to_PyErr();
|
|
579
|
+
return nullptr;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
else
|
|
583
|
+
{
|
|
584
|
+
py::set_invalid_arg_count_error(arg_count);
|
|
585
|
+
return nullptr;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
static PyObject* FaceTracker_get_MinDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self, void* /*unused*/) noexcept
|
|
590
|
+
{
|
|
591
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"MinDetectableFaceSize"))
|
|
592
|
+
{
|
|
593
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
594
|
+
return nullptr;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
try
|
|
598
|
+
{
|
|
599
|
+
return py::convert(self->obj.MinDetectableFaceSize());
|
|
600
|
+
}
|
|
601
|
+
catch (...)
|
|
602
|
+
{
|
|
603
|
+
py::to_PyErr();
|
|
604
|
+
return nullptr;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
static int FaceTracker_put_MinDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self, PyObject* arg, void* /*unused*/) noexcept
|
|
609
|
+
{
|
|
610
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"MinDetectableFaceSize"))
|
|
611
|
+
{
|
|
612
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
613
|
+
return -1;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
if (arg == nullptr)
|
|
617
|
+
{
|
|
618
|
+
PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
|
|
619
|
+
return -1;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
try
|
|
623
|
+
{
|
|
624
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapSize>(arg);
|
|
625
|
+
|
|
626
|
+
self->obj.MinDetectableFaceSize(param0);
|
|
627
|
+
return 0;
|
|
628
|
+
}
|
|
629
|
+
catch (...)
|
|
630
|
+
{
|
|
631
|
+
py::to_PyErr();
|
|
632
|
+
return -1;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
static PyObject* FaceTracker_get_MaxDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self, void* /*unused*/) noexcept
|
|
637
|
+
{
|
|
638
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"MaxDetectableFaceSize"))
|
|
639
|
+
{
|
|
640
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
641
|
+
return nullptr;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
try
|
|
645
|
+
{
|
|
646
|
+
return py::convert(self->obj.MaxDetectableFaceSize());
|
|
647
|
+
}
|
|
648
|
+
catch (...)
|
|
649
|
+
{
|
|
650
|
+
py::to_PyErr();
|
|
651
|
+
return nullptr;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
static int FaceTracker_put_MaxDetectableFaceSize(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker* self, PyObject* arg, void* /*unused*/) noexcept
|
|
656
|
+
{
|
|
657
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"MaxDetectableFaceSize"))
|
|
658
|
+
{
|
|
659
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
660
|
+
return -1;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (arg == nullptr)
|
|
664
|
+
{
|
|
665
|
+
PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
|
|
666
|
+
return -1;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
try
|
|
670
|
+
{
|
|
671
|
+
auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::BitmapSize>(arg);
|
|
672
|
+
|
|
673
|
+
self->obj.MaxDetectableFaceSize(param0);
|
|
674
|
+
return 0;
|
|
675
|
+
}
|
|
676
|
+
catch (...)
|
|
677
|
+
{
|
|
678
|
+
py::to_PyErr();
|
|
679
|
+
return -1;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
static PyObject* FaceTracker_get_IsSupported(PyObject* /*unused*/, void* /*unused*/) noexcept
|
|
684
|
+
{
|
|
685
|
+
if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.FaceAnalysis.FaceTracker", L"IsSupported"))
|
|
686
|
+
{
|
|
687
|
+
PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
|
|
688
|
+
return nullptr;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
try
|
|
692
|
+
{
|
|
693
|
+
return py::convert(winrt::Windows::Media::FaceAnalysis::FaceTracker::IsSupported());
|
|
694
|
+
}
|
|
695
|
+
catch (...)
|
|
696
|
+
{
|
|
697
|
+
py::to_PyErr();
|
|
698
|
+
return nullptr;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
static PyObject* _assign_array_FaceTracker(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
703
|
+
{
|
|
704
|
+
auto array = std::make_unique<py::ComArray<winrt::Windows::Media::FaceAnalysis::FaceTracker>>();
|
|
705
|
+
if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
|
|
706
|
+
{
|
|
707
|
+
return nullptr;
|
|
708
|
+
}
|
|
709
|
+
Py_RETURN_NONE;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
static PyObject* _from_FaceTracker(PyObject* /*unused*/, PyObject* arg) noexcept
|
|
713
|
+
{
|
|
714
|
+
try
|
|
715
|
+
{
|
|
716
|
+
auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
|
|
717
|
+
return py::convert(return_value.as<winrt::Windows::Media::FaceAnalysis::FaceTracker>());
|
|
718
|
+
}
|
|
719
|
+
catch (...)
|
|
720
|
+
{
|
|
721
|
+
py::to_PyErr();
|
|
722
|
+
return nullptr;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
static PyMethodDef _methods_FaceTracker[] = {
|
|
727
|
+
{ "process_next_frame_async", reinterpret_cast<PyCFunction>(FaceTracker_ProcessNextFrameAsync), METH_VARARGS, nullptr },
|
|
728
|
+
{ "_assign_array_", _assign_array_FaceTracker, METH_O | METH_STATIC, nullptr },
|
|
729
|
+
{ "_from", reinterpret_cast<PyCFunction>(_from_FaceTracker), METH_O | METH_STATIC, nullptr },
|
|
730
|
+
{ }
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
static PyGetSetDef _getset_FaceTracker[] = {
|
|
734
|
+
{ "min_detectable_face_size", reinterpret_cast<getter>(FaceTracker_get_MinDetectableFaceSize), reinterpret_cast<setter>(FaceTracker_put_MinDetectableFaceSize), nullptr, nullptr },
|
|
735
|
+
{ "max_detectable_face_size", reinterpret_cast<getter>(FaceTracker_get_MaxDetectableFaceSize), reinterpret_cast<setter>(FaceTracker_put_MaxDetectableFaceSize), nullptr, nullptr },
|
|
736
|
+
{ }
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
static PyType_Slot _type_slots_FaceTracker[] =
|
|
740
|
+
{
|
|
741
|
+
{ Py_tp_new, reinterpret_cast<void*>(_new_FaceTracker) },
|
|
742
|
+
{ Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FaceTracker) },
|
|
743
|
+
{ Py_tp_methods, reinterpret_cast<void*>(_methods_FaceTracker) },
|
|
744
|
+
{ Py_tp_getset, reinterpret_cast<void*>(_getset_FaceTracker) },
|
|
745
|
+
{ },
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
static PyType_Spec type_spec_FaceTracker =
|
|
749
|
+
{
|
|
750
|
+
"winrt._winrt_windows_media_faceanalysis.FaceTracker",
|
|
751
|
+
sizeof(py::wrapper::Windows::Media::FaceAnalysis::FaceTracker),
|
|
752
|
+
0,
|
|
753
|
+
Py_TPFLAGS_DEFAULT,
|
|
754
|
+
_type_slots_FaceTracker
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
static PyGetSetDef getset_FaceTracker_Static[] = {
|
|
758
|
+
{ "is_supported", reinterpret_cast<getter>(FaceTracker_get_IsSupported), nullptr, nullptr, nullptr },
|
|
759
|
+
{ }
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
static PyMethodDef methods_FaceTracker_Static[] = {
|
|
763
|
+
{ "create_async", reinterpret_cast<PyCFunction>(FaceTracker_CreateAsync), METH_VARARGS, nullptr },
|
|
764
|
+
{ "get_supported_bitmap_pixel_formats", reinterpret_cast<PyCFunction>(FaceTracker_GetSupportedBitmapPixelFormats), METH_VARARGS, nullptr },
|
|
765
|
+
{ "is_bitmap_pixel_format_supported", reinterpret_cast<PyCFunction>(FaceTracker_IsBitmapPixelFormatSupported), METH_VARARGS, nullptr },
|
|
766
|
+
{ }
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
static PyType_Slot type_slots_FaceTracker_Static[] =
|
|
770
|
+
{
|
|
771
|
+
{ Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
|
|
772
|
+
{ Py_tp_getset, reinterpret_cast<void*>(getset_FaceTracker_Static) },
|
|
773
|
+
{ Py_tp_methods, reinterpret_cast<void*>(methods_FaceTracker_Static) },
|
|
774
|
+
{ }
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
static PyType_Spec type_spec_FaceTracker_Static =
|
|
778
|
+
{
|
|
779
|
+
"winrt._winrt_windows_media_faceanalysis.FaceTracker_Static",
|
|
780
|
+
static_cast<int>(PyType_Type.tp_basicsize),
|
|
781
|
+
static_cast<int>(PyType_Type.tp_itemsize),
|
|
782
|
+
Py_TPFLAGS_DEFAULT,
|
|
783
|
+
type_slots_FaceTracker_Static
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
// ----- Windows.Media.FaceAnalysis Initialization --------------------
|
|
787
|
+
PyDoc_STRVAR(module_doc, "Windows::Media::FaceAnalysis");
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
static PyModuleDef module_def
|
|
791
|
+
= {PyModuleDef_HEAD_INIT,
|
|
792
|
+
"_winrt_windows_media_faceanalysis",
|
|
793
|
+
module_doc,
|
|
794
|
+
0,
|
|
795
|
+
nullptr,
|
|
796
|
+
nullptr,
|
|
797
|
+
nullptr,
|
|
798
|
+
nullptr,
|
|
799
|
+
nullptr};
|
|
800
|
+
|
|
801
|
+
} // py::cpp::Windows::Media::FaceAnalysis
|
|
802
|
+
|
|
803
|
+
PyMODINIT_FUNC PyInit__winrt_windows_media_faceanalysis(void) noexcept
|
|
804
|
+
{
|
|
805
|
+
using namespace py::cpp::Windows::Media::FaceAnalysis;
|
|
806
|
+
|
|
807
|
+
if (py::import_winrt_runtime() == -1)
|
|
808
|
+
{
|
|
809
|
+
return nullptr;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
py::pyobj_handle module{PyModule_Create(&module_def)};
|
|
813
|
+
|
|
814
|
+
if (!module)
|
|
815
|
+
{
|
|
816
|
+
return nullptr;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
auto object_type = py::get_object_type();
|
|
820
|
+
if (!object_type)
|
|
821
|
+
{
|
|
822
|
+
return nullptr;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};
|
|
826
|
+
|
|
827
|
+
if (!object_bases)
|
|
828
|
+
{
|
|
829
|
+
return nullptr;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
if (py::register_python_type(module.get(), &type_spec_DetectedFace, object_bases.get(), nullptr) == -1)
|
|
833
|
+
{
|
|
834
|
+
return nullptr;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
py::pyobj_handle type_FaceDetector_Static{PyType_FromSpec(&type_spec_FaceDetector_Static)};
|
|
838
|
+
if (!type_FaceDetector_Static)
|
|
839
|
+
{
|
|
840
|
+
return nullptr;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
if (py::register_python_type(module.get(), &type_spec_FaceDetector, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_FaceDetector_Static.get())) == -1)
|
|
844
|
+
{
|
|
845
|
+
return nullptr;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
py::pyobj_handle type_FaceTracker_Static{PyType_FromSpec(&type_spec_FaceTracker_Static)};
|
|
849
|
+
if (!type_FaceTracker_Static)
|
|
850
|
+
{
|
|
851
|
+
return nullptr;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
if (py::register_python_type(module.get(), &type_spec_FaceTracker, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_FaceTracker_Static.get())) == -1)
|
|
855
|
+
{
|
|
856
|
+
return nullptr;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
return module.detach();
|
|
861
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# WARNING: Please don't edit this file. It was automatically generated.
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools", "setuptools-scm", "winrt-sdk"]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "winrt-Windows.Media.FaceAnalysis"
|
|
9
|
+
description = "Python projection of Windows Runtime (WinRT) APIs"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Operating System :: Microsoft :: Windows",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
]
|
|
18
|
+
dynamic = ["version", "dependencies", "optional-dependencies"]
|
|
19
|
+
requires-python = ">=3.9,<3.13"
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
# Homepage = "https://github.com/pywrint/pywrinrt"
|
|
23
|
+
# Documentation = "https://readthedocs.org"
|
|
24
|
+
Repository = "https://github.com/pywrint/pywrinrt"
|
|
25
|
+
Changelog = "https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md"
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.dynamic]
|
|
28
|
+
version = { file = "pywinrt-version.txt" }
|
|
29
|
+
dependencies = { file = "requirements.txt" }
|
|
30
|
+
optional-dependencies.all = { file = "all-requirements.txt" }
|
|
31
|
+
|
|
32
|
+
[tool.cibuildwheel]
|
|
33
|
+
# use local winrt-sdk build dependency
|
|
34
|
+
environment = { PYTHONPATH="../winrt-sdk/src" }
|
|
35
|
+
# don't install winrt-sdk from PyPI
|
|
36
|
+
build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
|
|
37
|
+
# don't build for PyPy
|
|
38
|
+
skip = "pp*"
|
|
39
|
+
# suppress warnings about ARM64 testing
|
|
40
|
+
test-skip = "*-win_arm64"
|
|
41
|
+
|
|
42
|
+
[tool.cibuildwheel.windows]
|
|
43
|
+
archs = ["x86", "AMD64", "ARM64"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.0-beta.1
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# WARNING: Please don't edit this file. It was automatically generated.
|
|
2
|
+
|
|
3
|
+
from setuptools import Extension, setup
|
|
4
|
+
from winrt_sdk import get_include_dirs
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
ext_modules=[
|
|
8
|
+
Extension(
|
|
9
|
+
"winrt._winrt_windows_media_faceanalysis",
|
|
10
|
+
sources=["py.Windows.Media.FaceAnalysis.cpp"],
|
|
11
|
+
include_dirs=get_include_dirs(),
|
|
12
|
+
extra_compile_args=["/std:c++20", "/permissive-"],
|
|
13
|
+
libraries=["windowsapp"],
|
|
14
|
+
)
|
|
15
|
+
],
|
|
16
|
+
package_data={"winrt": ["*.pyi"]},
|
|
17
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
import sys
|
|
5
|
+
import types
|
|
6
|
+
import typing
|
|
7
|
+
import uuid as _uuid
|
|
8
|
+
from builtins import property as _property
|
|
9
|
+
|
|
10
|
+
import winrt._winrt
|
|
11
|
+
import winrt.system
|
|
12
|
+
import winrt.windows.foundation
|
|
13
|
+
import winrt.windows.foundation.collections
|
|
14
|
+
import winrt.windows.graphics.imaging
|
|
15
|
+
import winrt.windows.media
|
|
16
|
+
|
|
17
|
+
Self = typing.TypeVar('Self')
|
|
18
|
+
|
|
19
|
+
class DetectedFace(winrt.system.Object):
|
|
20
|
+
@staticmethod
|
|
21
|
+
def _from(obj: winrt.system.Object, /) -> DetectedFace: ...
|
|
22
|
+
@_property
|
|
23
|
+
def face_box(self) -> winrt.windows.graphics.imaging.BitmapBounds: ...
|
|
24
|
+
|
|
25
|
+
class FaceDetector_Static(type):
|
|
26
|
+
def create_async(cls) -> winrt.windows.foundation.IAsyncOperation[FaceDetector]: ...
|
|
27
|
+
def get_supported_bitmap_pixel_formats(cls) -> typing.Optional[winrt.windows.foundation.collections.IVectorView[winrt.windows.graphics.imaging.BitmapPixelFormat]]: ...
|
|
28
|
+
def is_bitmap_pixel_format_supported(cls, bitmap_pixel_format: winrt.windows.graphics.imaging.BitmapPixelFormat, /) -> bool: ...
|
|
29
|
+
@_property
|
|
30
|
+
def is_supported(cls) -> bool: ...
|
|
31
|
+
|
|
32
|
+
class FaceDetector(winrt.system.Object, metaclass=FaceDetector_Static):
|
|
33
|
+
@staticmethod
|
|
34
|
+
def _from(obj: winrt.system.Object, /) -> FaceDetector: ...
|
|
35
|
+
@typing.overload
|
|
36
|
+
def detect_faces_async(self, image: typing.Optional[winrt.windows.graphics.imaging.SoftwareBitmap], /) -> winrt.windows.foundation.IAsyncOperation[winrt.windows.foundation.collections.IVector[DetectedFace]]: ...
|
|
37
|
+
@typing.overload
|
|
38
|
+
def detect_faces_async(self, image: typing.Optional[winrt.windows.graphics.imaging.SoftwareBitmap], search_area: winrt.windows.graphics.imaging.BitmapBounds, /) -> winrt.windows.foundation.IAsyncOperation[winrt.windows.foundation.collections.IVector[DetectedFace]]: ...
|
|
39
|
+
@_property
|
|
40
|
+
def min_detectable_face_size(self) -> winrt.windows.graphics.imaging.BitmapSize: ...
|
|
41
|
+
@min_detectable_face_size.setter
|
|
42
|
+
def min_detectable_face_size(self, value: winrt.windows.graphics.imaging.BitmapSize) -> None: ...
|
|
43
|
+
@_property
|
|
44
|
+
def max_detectable_face_size(self) -> winrt.windows.graphics.imaging.BitmapSize: ...
|
|
45
|
+
@max_detectable_face_size.setter
|
|
46
|
+
def max_detectable_face_size(self, value: winrt.windows.graphics.imaging.BitmapSize) -> None: ...
|
|
47
|
+
|
|
48
|
+
class FaceTracker_Static(type):
|
|
49
|
+
def create_async(cls) -> winrt.windows.foundation.IAsyncOperation[FaceTracker]: ...
|
|
50
|
+
def get_supported_bitmap_pixel_formats(cls) -> typing.Optional[winrt.windows.foundation.collections.IVectorView[winrt.windows.graphics.imaging.BitmapPixelFormat]]: ...
|
|
51
|
+
def is_bitmap_pixel_format_supported(cls, bitmap_pixel_format: winrt.windows.graphics.imaging.BitmapPixelFormat, /) -> bool: ...
|
|
52
|
+
@_property
|
|
53
|
+
def is_supported(cls) -> bool: ...
|
|
54
|
+
|
|
55
|
+
class FaceTracker(winrt.system.Object, metaclass=FaceTracker_Static):
|
|
56
|
+
@staticmethod
|
|
57
|
+
def _from(obj: winrt.system.Object, /) -> FaceTracker: ...
|
|
58
|
+
def process_next_frame_async(self, video_frame: typing.Optional[winrt.windows.media.VideoFrame], /) -> winrt.windows.foundation.IAsyncOperation[winrt.windows.foundation.collections.IVector[DetectedFace]]: ...
|
|
59
|
+
@_property
|
|
60
|
+
def min_detectable_face_size(self) -> winrt.windows.graphics.imaging.BitmapSize: ...
|
|
61
|
+
@min_detectable_face_size.setter
|
|
62
|
+
def min_detectable_face_size(self, value: winrt.windows.graphics.imaging.BitmapSize) -> None: ...
|
|
63
|
+
@_property
|
|
64
|
+
def max_detectable_face_size(self) -> winrt.windows.graphics.imaging.BitmapSize: ...
|
|
65
|
+
@max_detectable_face_size.setter
|
|
66
|
+
def max_detectable_face_size(self, value: winrt.windows.graphics.imaging.BitmapSize) -> None: ...
|
|
67
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
|
|
2
|
+
|
|
3
|
+
import winrt.system
|
|
4
|
+
from winrt import _winrt_windows_media_faceanalysis
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"DetectedFace",
|
|
8
|
+
"FaceDetector",
|
|
9
|
+
"FaceTracker",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
DetectedFace = _winrt_windows_media_faceanalysis.DetectedFace
|
|
13
|
+
FaceDetector = _winrt_windows_media_faceanalysis.FaceDetector
|
|
14
|
+
FaceTracker = _winrt_windows_media_faceanalysis.FaceTracker
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: winrt-Windows.Media.FaceAnalysis
|
|
3
|
+
Version: 2.0.0b1
|
|
4
|
+
Summary: Python projection of Windows Runtime (WinRT) APIs
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/pywrint/pywrinrt
|
|
7
|
+
Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Requires-Python: <3.13,>=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Provides-Extra: all
|
|
15
|
+
|
|
16
|
+
<!-- warning: Please don't edit this file. It was automatically generated. -->
|
|
17
|
+
|
|
18
|
+
# winrt-Windows.Media.FaceAnalysis
|
|
19
|
+
|
|
20
|
+
Windows Runtime (WinRT) APIs for for the `Windows.Media.FaceAnalysis` namespace.
|
|
21
|
+
|
|
22
|
+
This package provides the `winrt.windows.media.faceanalysis` module.
|
winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
all-requirements.txt
|
|
3
|
+
py.Windows.Media.FaceAnalysis.cpp
|
|
4
|
+
pyproject.toml
|
|
5
|
+
pywinrt-version.txt
|
|
6
|
+
requirements.txt
|
|
7
|
+
setup.py
|
|
8
|
+
winrt/_winrt_windows_media_faceanalysis.pyi
|
|
9
|
+
winrt/windows/media/faceanalysis/__init__.py
|
|
10
|
+
winrt_Windows.Media.FaceAnalysis.egg-info/PKG-INFO
|
|
11
|
+
winrt_Windows.Media.FaceAnalysis.egg-info/SOURCES.txt
|
|
12
|
+
winrt_Windows.Media.FaceAnalysis.egg-info/dependency_links.txt
|
|
13
|
+
winrt_Windows.Media.FaceAnalysis.egg-info/requires.txt
|
|
14
|
+
winrt_Windows.Media.FaceAnalysis.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
winrt-Windows.Media.FaceAnalysis-2.0.0b1/winrt_Windows.Media.FaceAnalysis.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
winrt
|