You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To write unit tests for code which uses this library, without using your Vuforia quota, you can use the https://github.com/adamtheturtle/vws-python-mock tool:
56
+
To write unit tests for code which uses this library, without using your Vuforia quota, you can use the `VWS Python Mock`_ tool:
25
57
26
-
XXX example
58
+
.. code:: sh
27
59
28
-
There are some differences... see XXX for details
60
+
pip3 install vws-python-mock
29
61
62
+
.. code:: python
30
63
31
-
Reference
32
-
---------
64
+
from mock_vws import MockVWS, VuforiaDatabase
65
+
66
+
with MockVWS() as mock:
67
+
database = VuforiaDatabase()
68
+
mock.add_database(database=database)
69
+
vws_client = VWS(
70
+
server_access_key=server_access_key,
71
+
server_secret_key=server_secret_key,
72
+
)
73
+
cloud_reco_client = CloudRecoService(
74
+
client_access_key=client_access_key,
75
+
client_secret_key=client_secret_key,
76
+
)
77
+
78
+
name ='my_image_name'
79
+
80
+
withopen('/path/to/image.png', 'rb') as my_image_file:
81
+
my_image = io.BytesIO(my_image_file.read())
82
+
83
+
target_id = vws_client.add_target(
84
+
name=name,
85
+
width=1,
86
+
image=my_image,
87
+
)
33
88
34
-
.. automodule:: vws
35
-
:undoc-members:
36
-
:members:
89
+
There are some differences between the mock and the real Vuforia.
90
+
See https://vws-python-mock.readthedocs.io/en/latest/differences-to-vws.html for details.
0 commit comments