vaapi 0.1.0__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.
- vaapi-0.1.0/PKG-INFO +15 -0
- vaapi-0.1.0/README.md +2 -0
- vaapi-0.1.0/setup.cfg +4 -0
- vaapi-0.1.0/setup.py +27 -0
- vaapi-0.1.0/vaapi/__init__.py +1 -0
- vaapi-0.1.0/vaapi/vaapi.py +101 -0
- vaapi-0.1.0/vaapi.egg-info/PKG-INFO +15 -0
- vaapi-0.1.0/vaapi.egg-info/SOURCES.txt +10 -0
- vaapi-0.1.0/vaapi.egg-info/dependency_links.txt +1 -0
- vaapi-0.1.0/vaapi.egg-info/not-zip-safe +1 -0
- vaapi-0.1.0/vaapi.egg-info/requires.txt +2 -0
- vaapi-0.1.0/vaapi.egg-info/top_level.txt +1 -0
vaapi-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: vaapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python utils for adding logs to our Visual Analytics Tool
|
|
5
|
+
Home-page: UNKNOWN
|
|
6
|
+
Author: NaoTH Berlin United
|
|
7
|
+
Author-email: nao-team@informatik.hu-berlin.de
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Requires-Python: >=3.6.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# Berlin United - Visual Analytics Tool
|
|
14
|
+
Work in progress for an Analytics tool tailored to the needs of RoboCup SPL.
|
|
15
|
+
|
vaapi-0.1.0/README.md
ADDED
vaapi-0.1.0/setup.cfg
ADDED
vaapi-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
# The directory containing this file
|
|
6
|
+
HERE = Path(__file__).parent
|
|
7
|
+
|
|
8
|
+
# The text of the README file
|
|
9
|
+
README = (HERE / "README.md").read_text()
|
|
10
|
+
VERSION_STRING = (HERE / "VERSION").read_text()
|
|
11
|
+
|
|
12
|
+
setup(name='vaapi',
|
|
13
|
+
version=VERSION_STRING,
|
|
14
|
+
author='NaoTH Berlin United',
|
|
15
|
+
author_email='nao-team@informatik.hu-berlin.de',
|
|
16
|
+
description='Python utils for adding logs to our Visual Analytics Tool',
|
|
17
|
+
long_description=README,
|
|
18
|
+
long_description_content_type="text/markdown",
|
|
19
|
+
packages=find_packages(exclude=["tests"]),
|
|
20
|
+
license='Apache License 2.0',
|
|
21
|
+
zip_safe=False,
|
|
22
|
+
setup_requires=['wheel'],
|
|
23
|
+
install_requires=[
|
|
24
|
+
'protobuf==3.20.3', 'numpy'
|
|
25
|
+
],
|
|
26
|
+
python_requires='>=3.6.9',
|
|
27
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import vaapi
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import requests,logging
|
|
2
|
+
|
|
3
|
+
class vaapi:
|
|
4
|
+
def __init__(self,base_url:str,auth):
|
|
5
|
+
self.base_url = base_url
|
|
6
|
+
self.auth = auth
|
|
7
|
+
#we are creating a session to reduce time and resources for each request
|
|
8
|
+
self.session = requests.Session()
|
|
9
|
+
self.headers = {"Connection": "keep-alive" ,"Content-Type": "application/json"}
|
|
10
|
+
def get(self,endpoint,parameter):
|
|
11
|
+
endpoint = f"{endpoint}/{parameter}" if parameter is not None else f"{endpoint}/"
|
|
12
|
+
try:
|
|
13
|
+
logging.debug(self.base_url+endpoint)
|
|
14
|
+
response =self.session.get(self.base_url+endpoint, auth=self.auth)
|
|
15
|
+
response.raise_for_status()
|
|
16
|
+
return response.json()
|
|
17
|
+
except requests.exceptions.RequestException as e:
|
|
18
|
+
logging.debug(f"Error making Request:\n{e}")
|
|
19
|
+
return
|
|
20
|
+
|
|
21
|
+
def post(self,endpoint:str,data:dict):
|
|
22
|
+
try:
|
|
23
|
+
response = self.session.post(f"{self.base_url}{endpoint}/",data=data, auth=self.auth)
|
|
24
|
+
response.raise_for_status()
|
|
25
|
+
return response.json()
|
|
26
|
+
except requests.exceptions.RequestException as e:
|
|
27
|
+
logging.debug(f"Error making Request:\n{e}")
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
def patch(self,endpoint:str,data:dict,parameter=None):
|
|
31
|
+
#not sure explicit or implicit would be better
|
|
32
|
+
endpoint = f"{endpoint}/{parameter}/"
|
|
33
|
+
#endpoint = f"{endpoint}/{data.get("id")}/"
|
|
34
|
+
try:
|
|
35
|
+
response = self.session.patch(self.base_url+endpoint,data=data, auth=self.auth)
|
|
36
|
+
response.raise_for_status()
|
|
37
|
+
return response.json()
|
|
38
|
+
except requests.exceptions.RequestException as e:
|
|
39
|
+
logging.debug(f"Error making Request:\n{e}")
|
|
40
|
+
return
|
|
41
|
+
#event
|
|
42
|
+
def get_event(self,id=None):
|
|
43
|
+
return self.get("events",id)
|
|
44
|
+
|
|
45
|
+
def add_event(self,event:dict):
|
|
46
|
+
return self.post("events",event)
|
|
47
|
+
|
|
48
|
+
def change_event(self,event:dict,id=None):
|
|
49
|
+
return self.patch("events",event,id)
|
|
50
|
+
|
|
51
|
+
#games
|
|
52
|
+
def get_games(self,id=None):
|
|
53
|
+
return self.get("games",id)
|
|
54
|
+
|
|
55
|
+
def add_games(self,games:dict):
|
|
56
|
+
return self.post("games",games)
|
|
57
|
+
|
|
58
|
+
def change_games(self,games:dict,id=None):
|
|
59
|
+
return self.patch("games",games,id)
|
|
60
|
+
|
|
61
|
+
#logs
|
|
62
|
+
def get_log(self,id=None):
|
|
63
|
+
return self.get("logs",id)
|
|
64
|
+
|
|
65
|
+
def add_log(self,log:dict):
|
|
66
|
+
return self.post("logs",log)
|
|
67
|
+
|
|
68
|
+
def change_log(self,log:dict,id=None):
|
|
69
|
+
return self.patch("logs",log,id)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
#CameraMatrix
|
|
73
|
+
def get_camera_matrix(self,id=None):
|
|
74
|
+
return self.get("camera_matrix",id)
|
|
75
|
+
|
|
76
|
+
def add_camera_matrix(self,camera_matrix:dict):
|
|
77
|
+
return self.post("camera_matrix",camera_matrix)
|
|
78
|
+
|
|
79
|
+
def change_camera_matrix(self,camera_matrix:dict,id=None):
|
|
80
|
+
return self.patch("camera_matrix",camera_matrix,id)
|
|
81
|
+
|
|
82
|
+
#Image
|
|
83
|
+
def get_image(self,id=None):
|
|
84
|
+
return self.get("image",id)
|
|
85
|
+
|
|
86
|
+
def add_image(self,image:dict):
|
|
87
|
+
return self.post("image",image)
|
|
88
|
+
|
|
89
|
+
def change_image(self,image:dict,id=None):
|
|
90
|
+
return self.patch("image",image,id)
|
|
91
|
+
|
|
92
|
+
#Image Annotation
|
|
93
|
+
def get_imageannotation(self,id=None):
|
|
94
|
+
return self.get("imageannotation",id)
|
|
95
|
+
|
|
96
|
+
def add_imageannotation(self,annotation:dict):
|
|
97
|
+
return self.post("imageannotation",annotation)
|
|
98
|
+
|
|
99
|
+
def change_imageannotation(self,annotation:dict,id=None):
|
|
100
|
+
return self.patch("imageannotation",annotation,id)
|
|
101
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: vaapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python utils for adding logs to our Visual Analytics Tool
|
|
5
|
+
Home-page: UNKNOWN
|
|
6
|
+
Author: NaoTH Berlin United
|
|
7
|
+
Author-email: nao-team@informatik.hu-berlin.de
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Requires-Python: >=3.6.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# Berlin United - Visual Analytics Tool
|
|
14
|
+
Work in progress for an Analytics tool tailored to the needs of RoboCup SPL.
|
|
15
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vaapi
|