|
| 1 | +[](https://github.com/VWS-Python/vws-python/actions) |
| 3 | +[](https://codecov.io/gh/VWS-Python/vws-python) |
| 4 | +[](https://badge.fury.io/py/VWS-Python) |
| 5 | +[](https://vws-python.readthedocs.io/en/latest/?badge=latest) |
| 6 | + |
| 7 | +# vws-python |
| 8 | + |
| 9 | +Python library for the Vuforia Web Services (VWS) API and the Vuforia |
| 10 | +Web Query API. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +```sh |
| 15 | +pip install vws-python |
| 16 | +``` |
| 17 | + |
| 18 | +This is tested on Python 3.11+. Get in touch with |
| 19 | +`adamdangoor@gmail.com` if you would like to use this with another |
| 20 | +language. |
| 21 | + |
| 22 | +## Getting Started |
| 23 | + |
| 24 | +```python |
| 25 | +import io |
| 26 | +import pathlib |
| 27 | + |
| 28 | +from vws import VWS, CloudRecoService |
| 29 | + |
| 30 | +server_access_key = '[server-access-key]' |
| 31 | +server_secret_key = '[server-secret-key]' |
| 32 | +client_access_key = '[client-access-key]' |
| 33 | +client_secret_key = '[client-secret-key]' |
| 34 | + |
| 35 | +vws_client = VWS( |
| 36 | + server_access_key=server_access_key, |
| 37 | + server_secret_key=server_secret_key, |
| 38 | +) |
| 39 | +cloud_reco_client = CloudRecoService( |
| 40 | + client_access_key=client_access_key, |
| 41 | + client_secret_key=client_secret_key, |
| 42 | +) |
| 43 | +name = 'my_image_name' |
| 44 | + |
| 45 | +image = pathlib.Path('high_quality_image.jpg') |
| 46 | +with image.open(mode='rb') as my_image_file: |
| 47 | + my_image = io.BytesIO(my_image_file.read()) |
| 48 | + |
| 49 | +target_id = vws_client.add_target( |
| 50 | + name=name, |
| 51 | + width=1, |
| 52 | + image=my_image, |
| 53 | + active_flag=True, |
| 54 | + application_metadata=None, |
| 55 | +) |
| 56 | +vws_client.wait_for_target_processed(target_id=target_id) |
| 57 | +matching_targets = cloud_reco_client.query(image=my_image) |
| 58 | + |
| 59 | +assert matching_targets[0].target_id == target_id |
| 60 | +``` |
| 61 | + |
| 62 | +## Full Documentation |
| 63 | + |
| 64 | +See the [full |
| 65 | +documentation](https://vws-python.readthedocs.io/en/latest). |
0 commit comments