vaapi 0.7.30__tar.gz → 0.7.31__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.
Files changed (123) hide show
  1. {vaapi-0.7.30/vaapi.egg-info → vaapi-0.7.31}/PKG-INFO +3 -4
  2. {vaapi-0.7.30 → vaapi-0.7.31}/pyproject.toml +3 -5
  3. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/__init__.py +1 -1
  4. {vaapi-0.7.30 → vaapi-0.7.31/vaapi.egg-info}/PKG-INFO +3 -4
  5. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi.egg-info/SOURCES.txt +0 -41
  6. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi.egg-info/requires.txt +1 -1
  7. vaapi-0.7.30/.github/workflows/deploy_sdk.yml +0 -24
  8. vaapi-0.7.30/.gitignore +0 -9
  9. vaapi-0.7.30/examples/README.md +0 -18
  10. vaapi-0.7.30/examples/annotation_demo.py +0 -41
  11. vaapi-0.7.30/examples/ballcanditates.py +0 -22
  12. vaapi-0.7.30/examples/basics.py +0 -33
  13. vaapi-0.7.30/examples/behavior_demo.py +0 -14
  14. vaapi-0.7.30/examples/broken_demos/annotation_example.py +0 -26
  15. vaapi-0.7.30/examples/broken_demos/find_kicks_near_goal.py +0 -59
  16. vaapi-0.7.30/examples/broken_demos/frame_filter_example.py +0 -26
  17. vaapi-0.7.30/examples/broken_demos/frame_times.py +0 -26
  18. vaapi-0.7.30/examples/broken_demos/heatmap.py +0 -110
  19. vaapi-0.7.30/examples/bulk_image_update.py +0 -22
  20. vaapi-0.7.30/examples/file_upload.py +0 -21
  21. vaapi-0.7.30/examples/filter_behavior_demo.py +0 -99
  22. vaapi-0.7.30/examples/fix_images.py +0 -43
  23. vaapi-0.7.30/examples/get_annotations.py +0 -17
  24. vaapi-0.7.30/examples/get_frame_per_video_timestamp.py +0 -46
  25. vaapi-0.7.30/examples/get_game_model_data.py +0 -18
  26. vaapi-0.7.30/examples/get_image.py +0 -17
  27. vaapi-0.7.30/examples/get_log_model_data.py +0 -23
  28. vaapi-0.7.30/examples/get_teams.py +0 -17
  29. vaapi-0.7.30/examples/get_video_model_data.py +0 -35
  30. vaapi-0.7.30/examples/image_demo.py +0 -90
  31. vaapi-0.7.30/examples/image_pagination.py +0 -38
  32. vaapi-0.7.30/examples/imu_demo.py +0 -39
  33. vaapi-0.7.30/examples/mmap_local_demo.py +0 -42
  34. vaapi-0.7.30/examples/num_kicks_demo.py +0 -57
  35. vaapi-0.7.30/examples/num_kicks_demo_interactive.py +0 -66
  36. vaapi-0.7.30/examples/requirements.txt +0 -4
  37. vaapi-0.7.30/examples/robot.py +0 -11
  38. vaapi-0.7.30/examples/slice.py +0 -9
  39. vaapi-0.7.30/examples/team_demo.py +0 -19
  40. vaapi-0.7.30/package_pypi.sh +0 -13
  41. vaapi-0.7.30/renovate.json +0 -6
  42. vaapi-0.7.30/tests/run_tests.py +0 -26
  43. vaapi-0.7.30/tests/tests/cognition_repr_test.py +0 -20
  44. vaapi-0.7.30/tests/tests/event_tests.py +0 -25
  45. vaapi-0.7.30/tests/tests/game_tests.py +0 -22
  46. vaapi-0.7.30/tests/tests/logs_tests.py +0 -18
  47. vaapi-0.7.30/tests/tests/motion_repr_test.py +0 -20
  48. {vaapi-0.7.30 → vaapi-0.7.31}/README.md +0 -0
  49. {vaapi-0.7.30 → vaapi-0.7.31}/setup.cfg +0 -0
  50. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/base_client.py +0 -0
  51. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_frame_option/__init__.py +0 -0
  52. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_frame_option/client.py +0 -0
  53. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_options/__init__.py +0 -0
  54. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_options/client.py +0 -0
  55. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_options_state/__init__.py +0 -0
  56. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/behavior_options_state/client.py +0 -0
  57. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/client.py +0 -0
  58. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/cognition_frame/__init__.py +0 -0
  59. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/cognition_frame/client.py +0 -0
  60. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/cognition_representation/__init__.py +0 -0
  61. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/cognition_representation/client.py +0 -0
  62. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/api_error.py +0 -0
  63. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/client_wrapper.py +0 -0
  64. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/datetime_utils.py +0 -0
  65. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/file.py +0 -0
  66. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/http_client.py +0 -0
  67. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/jsonable_encoder.py +0 -0
  68. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/pagination.py +0 -0
  69. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/pydantic_utilities.py +0 -0
  70. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/query_encoder.py +0 -0
  71. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/remove_none_from_dict.py +0 -0
  72. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/core/request_options.py +0 -0
  73. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/events/__init__.py +0 -0
  74. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/events/client.py +0 -0
  75. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/experiment/__init__.py +0 -0
  76. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/experiment/client.py +0 -0
  77. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/game/__init__.py +0 -0
  78. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/game/client.py +0 -0
  79. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/image/__init__.py +0 -0
  80. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/image/client.py +0 -0
  81. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/log_status/__init__.py +0 -0
  82. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/log_status/client.py +0 -0
  83. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/logs/__init__.py +0 -0
  84. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/logs/client.py +0 -0
  85. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/motion_frame/__init__.py +0 -0
  86. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/motion_frame/client.py +0 -0
  87. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/motion_representation/__init__.py +0 -0
  88. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/motion_representation/client.py +0 -0
  89. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/robots/__init__.py +0 -0
  90. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/robots/client.py +0 -0
  91. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/teams/__init__.py +0 -0
  92. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/teams/client.py +0 -0
  93. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/timeline/__init__.py +0 -0
  94. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/timeline/client.py +0 -0
  95. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/annotation.py +0 -0
  96. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/behavior_option.py +0 -0
  97. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/behavior_option_state.py +0 -0
  98. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/behaviorframe_options.py +0 -0
  99. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/cognition_frame.py +0 -0
  100. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/cognition_representation.py +0 -0
  101. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/event.py +0 -0
  102. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/experiment.py +0 -0
  103. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/frame_filter.py +0 -0
  104. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/game.py +0 -0
  105. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/image.py +0 -0
  106. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/log.py +0 -0
  107. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/log_status.py +0 -0
  108. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/motion_frame.py +0 -0
  109. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/motion_representation.py +0 -0
  110. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/robots.py +0 -0
  111. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/teams.py +0 -0
  112. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/timeline.py +0 -0
  113. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/video.py +0 -0
  114. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/xabsl_symbol_complete.py +0 -0
  115. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/types/xabsl_symbol_sparse.py +0 -0
  116. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/videos/__init__.py +0 -0
  117. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/videos/client.py +0 -0
  118. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/xabsl_symbol_complete/__init__.py +0 -0
  119. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/xabsl_symbol_complete/client.py +0 -0
  120. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/xabsl_symbol_sparse/__init__.py +0 -0
  121. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi/xabsl_symbol_sparse/client.py +0 -0
  122. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi.egg-info/dependency_links.txt +0 -0
  123. {vaapi-0.7.30 → vaapi-0.7.31}/vaapi.egg-info/top_level.txt +0 -0
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vaapi
3
- Version: 0.7.30
3
+ Version: 0.7.31
4
4
  Summary: Python utils for adding logs to our Visual Analytics Tool
5
5
  Author-email: NaoTH Berlin United <nao-team@informatik.hu-berlin.de>
6
- License: Apache-2.0
6
+ License-Expression: Apache-2.0
7
7
  Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: Apache Software License
9
8
  Classifier: Operating System :: OS Independent
10
9
  Requires-Python: >=3.10.9
11
10
  Description-Content-Type: text/markdown
12
11
  Requires-Dist: protobuf==3.20.3
13
12
  Requires-Dist: httpx==0.28.1
14
13
  Requires-Dist: pydantic==2.12.5
15
- Requires-Dist: requests==2.32.5
14
+ Requires-Dist: requests==2.33.1
16
15
 
17
16
  # Berlin United - Visual Analytics Tool
18
17
  Work in progress for an Analytics tool tailored to the needs of RoboCup SPL.
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
2
+ requires = ["setuptools>=61", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -10,20 +10,18 @@ authors = [
10
10
  description = "Python utils for adding logs to our Visual Analytics Tool"
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10.9"
13
- license = { text = "Apache-2.0" }
13
+ license = "Apache-2.0"
14
14
  classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
- "License :: OSI Approved :: Apache Software License",
17
16
  "Operating System :: OS Independent",
18
17
  ]
19
18
  dynamic = ["version"]
20
- #[tool.setuptools_scm]
21
19
 
22
20
  dependencies = [
23
21
  "protobuf==3.20.3",
24
22
  "httpx==0.28.1",
25
23
  "pydantic==2.12.5",
26
- "requests==2.32.5",
24
+ "requests==2.33.1",
27
25
  ]
28
26
 
29
27
  [tool.setuptools.dynamic]
@@ -2,4 +2,4 @@
2
2
  you can perform with the API of the visual analytics tool by Berlin United for the Robocup SPL
3
3
  """
4
4
 
5
- __version__ = "0.7.30"
5
+ __version__ = "0.7.31"
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vaapi
3
- Version: 0.7.30
3
+ Version: 0.7.31
4
4
  Summary: Python utils for adding logs to our Visual Analytics Tool
5
5
  Author-email: NaoTH Berlin United <nao-team@informatik.hu-berlin.de>
6
- License: Apache-2.0
6
+ License-Expression: Apache-2.0
7
7
  Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: Apache Software License
9
8
  Classifier: Operating System :: OS Independent
10
9
  Requires-Python: >=3.10.9
11
10
  Description-Content-Type: text/markdown
12
11
  Requires-Dist: protobuf==3.20.3
13
12
  Requires-Dist: httpx==0.28.1
14
13
  Requires-Dist: pydantic==2.12.5
15
- Requires-Dist: requests==2.32.5
14
+ Requires-Dist: requests==2.33.1
16
15
 
17
16
  # Berlin United - Visual Analytics Tool
18
17
  Work in progress for an Analytics tool tailored to the needs of RoboCup SPL.
@@ -1,46 +1,5 @@
1
- .gitignore
2
1
  README.md
3
- package_pypi.sh
4
2
  pyproject.toml
5
- renovate.json
6
- .github/workflows/deploy_sdk.yml
7
- examples/README.md
8
- examples/annotation_demo.py
9
- examples/ballcanditates.py
10
- examples/basics.py
11
- examples/behavior_demo.py
12
- examples/bulk_image_update.py
13
- examples/file_upload.py
14
- examples/filter_behavior_demo.py
15
- examples/fix_images.py
16
- examples/get_annotations.py
17
- examples/get_frame_per_video_timestamp.py
18
- examples/get_game_model_data.py
19
- examples/get_image.py
20
- examples/get_log_model_data.py
21
- examples/get_teams.py
22
- examples/get_video_model_data.py
23
- examples/image_demo.py
24
- examples/image_pagination.py
25
- examples/imu_demo.py
26
- examples/mmap_local_demo.py
27
- examples/num_kicks_demo.py
28
- examples/num_kicks_demo_interactive.py
29
- examples/requirements.txt
30
- examples/robot.py
31
- examples/slice.py
32
- examples/team_demo.py
33
- examples/broken_demos/annotation_example.py
34
- examples/broken_demos/find_kicks_near_goal.py
35
- examples/broken_demos/frame_filter_example.py
36
- examples/broken_demos/frame_times.py
37
- examples/broken_demos/heatmap.py
38
- tests/run_tests.py
39
- tests/tests/cognition_repr_test.py
40
- tests/tests/event_tests.py
41
- tests/tests/game_tests.py
42
- tests/tests/logs_tests.py
43
- tests/tests/motion_repr_test.py
44
3
  vaapi/__init__.py
45
4
  vaapi/base_client.py
46
5
  vaapi/client.py
@@ -1,4 +1,4 @@
1
1
  protobuf==3.20.3
2
2
  httpx==0.28.1
3
3
  pydantic==2.12.5
4
- requests==2.32.5
4
+ requests==2.33.1
@@ -1,24 +0,0 @@
1
- name: GitHub Actions Demo
2
- run-name: ${{ github.actor }} is deploying the sdk 🚀
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches: ['main']
7
- env:
8
- PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
9
-
10
- jobs:
11
- Explore-GitHub-Actions:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - name: Check out repository code
15
- uses: actions/checkout@v4
16
- - name: Set up Python ${{ matrix.python-version }}
17
- uses: actions/setup-python@v5
18
- with:
19
- python-version: "3.12"
20
- - run: python -m pip install --upgrade pip setuptools wheel twine
21
- - name: Deploy sdk to pypi
22
- run: |
23
- /bin/bash package_pypi.sh
24
- - run: echo "🍏 This job's status is ${{ job.status }}."
vaapi-0.7.30/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- # setup.py stuff
2
- .eggs/
3
- *.egg-info
4
- build/
5
- dist/
6
- venv/
7
- .pypirc
8
- __pycache__/
9
- .envrc
@@ -1,18 +0,0 @@
1
- ## Demos for the Berlin United Visual Analytics Tool
2
-
3
- ## Setup
4
-
5
- ```bash
6
- python3 -m venv venv
7
- source venv/bin/activate
8
-
9
- python -m pip install -r requirements.txt
10
- ```
11
-
12
- You need to the environment variables for the URL and the API token.
13
- ```
14
- export VAT_API_URL=<http://127.0.0.1:8000/ or https://vat.berlin-united.com/>
15
- export VAT_API_TOKEN=<your token>
16
- ```
17
-
18
- If you are using vat.berlin-united.com you should have received a token from the admin. If you are using the self hosted version you can get the token by login to the django admin panel.
@@ -1,41 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
-
5
- def list_annotations_per_log():
6
- log = client.logs.list()
7
-
8
- def sort_key_fn(log):
9
- return log.id
10
-
11
- for log in sorted(log, key=sort_key_fn):
12
- count = client.annotations.count(
13
- log=log.id, class_name="ball", validated=False
14
- )["count"]
15
- if count < 100 and count > 0:
16
- print(f"{log.id} - {count} ball annotations")
17
-
18
-
19
- def print_annotation_stats():
20
- # FIXME we cant filter for camera yet
21
- all_annotations = client.annotations.count(type='bbox',class_name="ball")["count"]
22
- validated_annotations = client.annotations.count(type='bbox',class_name="ball", validated=True)[
23
- "count"
24
- ]
25
-
26
- validation_progress = (validated_annotations / all_annotations) * 100
27
-
28
- print(f"Percent of Ball Annotations validated: {validation_progress}%")
29
- print(
30
- f"You already validated {validated_annotations} Ball Annotations of of {all_annotations}"
31
- )
32
-
33
-
34
- if __name__ == "__main__":
35
- client = Vaapi(
36
- base_url=os.environ.get("VAT_API_URL"),
37
- api_key=os.environ.get("VAT_API_TOKEN"),
38
- )
39
-
40
- print_annotation_stats()
41
- # list_annotations_per_log()
@@ -1,22 +0,0 @@
1
- """
2
- Similar to
3
- response = client.ballcandidates.list(
4
- log_id=1,
5
- )
6
-
7
- you can use any representation name present in the game.log to query it except behavior. Behavior is handled differently.
8
- """
9
-
10
- from vaapi.client import Vaapi
11
- import os
12
-
13
-
14
- if __name__ == "__main__":
15
- client = Vaapi(
16
- base_url=os.environ.get("VAT_API_URL"),
17
- api_key=os.environ.get("VAT_API_TOKEN"),
18
- )
19
- response = client.ballcandidates.list(
20
- log=1,
21
- )
22
- print(response)
@@ -1,33 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
-
5
- def get_logs():
6
- response = client.logs.list()
7
- for log in response:
8
- print(f"{log.game} - Player: {log.player_number}")
9
-
10
- # you can print all fields of a log with:
11
- # response[0].dict()
12
-
13
-
14
- def get_games():
15
- response = client.games.list()
16
- for game in response:
17
- print(game)
18
-
19
-
20
- def get_experiments():
21
- response = client.experiment.list()
22
- for experiment in response:
23
- print(experiment)
24
-
25
-
26
- if __name__ == "__main__":
27
- client = Vaapi(
28
- base_url=os.environ.get("VAT_API_URL"),
29
- api_key=os.environ.get("VAT_API_TOKEN"),
30
- )
31
- get_games()
32
- get_logs()
33
- get_experiments()
@@ -1,14 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
- def get_all_states_for_option():
5
- behavior_option = client.behavior_option.list(log=282,option_name="fall_down_and_stand_up")
6
- behavior_option_states = client.behavior_option_state.list(log=282,option_id=behavior_option[0].id)
7
- print(behavior_option_states)
8
-
9
- if __name__ == "__main__":
10
- client = Vaapi(
11
- base_url=os.environ.get("VAT_API_URL"),
12
- api_key=os.environ.get("VAT_API_TOKEN"),
13
- )
14
- get_all_states_for_option()
@@ -1,26 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
-
5
- if __name__ == "__main__":
6
- client = Vaapi(
7
- base_url=os.environ.get("VAT_API_URL"),
8
- api_key=os.environ.get("VAT_API_TOKEN"),
9
- )
10
-
11
- resp = client.annotations.create(
12
- image_id=2,
13
- annotation={
14
- "bbox": [
15
- {
16
- "x": 170,
17
- "y": 280,
18
- "id": 123,
19
- "label": "ball",
20
- "width": 100,
21
- "height": 100,
22
- }
23
- ]
24
- },
25
- )
26
- print(resp)
@@ -1,59 +0,0 @@
1
- """ """
2
-
3
- from vaapi.client import Vaapi
4
- import os
5
-
6
-
7
- def group_consecutive_integers(numbers):
8
- if not numbers:
9
- return []
10
-
11
- # Sort the list
12
- sorted_numbers = sorted(numbers)
13
-
14
- # Initialize the result and the first group
15
- result = []
16
- current_group = [sorted_numbers[0]]
17
-
18
- # Iterate through the sorted list starting from the second element
19
- for num in sorted_numbers[1:]:
20
- if num == current_group[-1] + 1:
21
- # If the number is consecutive, add it to the current group
22
- current_group.append(num)
23
- else:
24
- # If there's a gap, add the current group to the result and start a new group
25
- result.append(current_group)
26
- current_group = [num]
27
-
28
- # Add the last group
29
- result.append(current_group)
30
-
31
- return result
32
-
33
-
34
- def find_kick_frames(client):
35
- response = client.behavior_frame_option.filter(
36
- log_id=168,
37
- option_name="path_striker2024",
38
- state_name="forwardkick",
39
- )
40
-
41
- grouped_numbers = group_consecutive_integers(response)
42
- print(f"Number of times the robot tried to kick: {len(grouped_numbers)}")
43
- for group in grouped_numbers:
44
- print(group[0])
45
- # TODO find the location in the xabsl symbols
46
- symbols = client.xabsl_symbol_sparse.list(log_id=168, frame=group[0])
47
-
48
- print(symbols[0].data["input"]["robot_pose.planned.x"])
49
-
50
- quit()
51
-
52
-
53
- if __name__ == "__main__":
54
- client = Vaapi(
55
- base_url=os.environ.get("VAT_API_URL"),
56
- api_key=os.environ.get("VAT_API_TOKEN"),
57
- )
58
-
59
- find_kick_frames(client)
@@ -1,26 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
-
5
- def frame_filter_demo(client):
6
- response = client.behavior_frame_option.filter(
7
- log_id=168,
8
- option_name="path_striker2024",
9
- state_name="forwardkick",
10
- )
11
-
12
- # publish the frames list
13
- resp = client.frame_filter.create(
14
- log_id=168,
15
- frames={"frame_list": response},
16
- )
17
- print(resp)
18
-
19
-
20
- if __name__ == "__main__":
21
- client = Vaapi(
22
- base_url=os.environ.get("VAT_API_URL"),
23
- api_key=os.environ.get("VAT_API_TOKEN"),
24
- )
25
-
26
- frame_filter_demo(client)
@@ -1,26 +0,0 @@
1
- from vaapi.client import Vaapi
2
- import os
3
-
4
-
5
- if __name__ == "__main__":
6
- client = Vaapi(
7
- base_url=os.environ.get("VAT_API_URL"),
8
- api_key=os.environ.get("VAT_API_TOKEN"),
9
- )
10
- """
11
- Get FrameInfo from Cognition Process
12
- """
13
- response = client.cognition_repr.list(
14
- log_id=168,
15
- representation_name="FrameInfo",
16
- )
17
- print(response[0])
18
-
19
- """
20
- Get FrameInfo from Motion Process
21
- """
22
- response = client.motion_repr.list(
23
- log_id=168,
24
- representation_name="FrameInfo",
25
- )
26
- print(response[0])
@@ -1,110 +0,0 @@
1
- """ """
2
-
3
- from vaapi.client import Vaapi
4
- import os
5
- import numpy as np
6
- import matplotlib.pyplot as plt
7
-
8
-
9
- def candidates_distribution(logs):
10
- x_list = list()
11
- y_list = list()
12
- for data in logs:
13
- response = client.cognition_repr.list(
14
- log_id=data.id,
15
- representation_name="BallCandidates",
16
- )
17
- print(len(response))
18
-
19
- for candidates in response:
20
- patch_list = candidates.representation_data["patches"]
21
- for patch in patch_list:
22
- mid_x = (patch["max"]["x"] + patch["min"]["x"]) / 2
23
- mid_y = (patch["max"]["y"] + patch["min"]["y"]) / 2
24
- x_list.append(mid_x)
25
- y_list.append(mid_y)
26
- break
27
-
28
- fig, ax = plt.subplots()
29
- plt.title("Frequency of Ball Canditates found in Image")
30
- h = ax.hist2d(x_list, y_list, bins=[np.arange(0, 640, 20), np.arange(0, 480, 20)])
31
- fig.colorbar(h[3], ax=ax)
32
- plt.savefig("candidates_distribution.png")
33
-
34
-
35
- def candidates_top_distribution(logs):
36
- x_list = list()
37
- y_list = list()
38
- for data in logs:
39
- response = client.cognition_repr.list(
40
- log_id=data.id,
41
- representation_name="BallCandidatesTop",
42
- )
43
- print(len(response))
44
-
45
- for candidates in response:
46
- patch_list = candidates.representation_data["patches"]
47
- for patch in patch_list:
48
- mid_x = (patch["max"]["x"] + patch["min"]["x"]) / 2
49
- mid_y = (patch["max"]["y"] + patch["min"]["y"]) / 2
50
- x_list.append(mid_x)
51
- y_list.append(mid_y)
52
- break
53
-
54
- fig, ax = plt.subplots()
55
- plt.title("Frequency of Ball Canditates found in Image Top")
56
- h = ax.hist2d(x_list, y_list, bins=[np.arange(0, 640, 20), np.arange(0, 480, 20)])
57
- fig.colorbar(h[3], ax=ax)
58
- plt.savefig("candidates_top_distribution.png")
59
-
60
-
61
- if __name__ == "__main__":
62
- client = Vaapi(
63
- base_url=os.environ.get("VAT_API_URL"),
64
- api_key=os.environ.get("VAT_API_TOKEN"),
65
- )
66
- logs = client.logs.list()
67
- # candidates_top_distribution(logs)
68
- # candidates_distribution(logs)
69
-
70
- x_list_top = list()
71
- y_list_top = list()
72
- x_list_bottom = list()
73
- y_list_bottom = list()
74
- for data in logs:
75
- print(data.log_path)
76
- response = client.cognition_repr.list(
77
- log_id=168,
78
- representation_name="MultiBallPercept",
79
- )
80
-
81
- for multipercept in response:
82
- if "percepts" in multipercept.representation_data:
83
- for percept in multipercept.representation_data["percepts"]:
84
- cx = percept["centerInImage"]["x"]
85
- cy = percept["centerInImage"]["y"]
86
- cam = percept["cameraId"]
87
- if cam == "top":
88
- x_list_top.append(cx)
89
- y_list_top.append(cy)
90
- else:
91
- x_list_bottom.append(cx)
92
- y_list_bottom.append(cy)
93
-
94
- fig, ax = plt.subplots()
95
- plt.title("Frequency of Ball Percepts found in Image Top")
96
- h = ax.hist2d(
97
- x_list_top, y_list_top, bins=[np.arange(0, 640, 20), np.arange(0, 480, 20)]
98
- )
99
- fig.colorbar(h[3], ax=ax)
100
- plt.savefig("ball_percepts_top_distribution.png")
101
-
102
- fig, ax = plt.subplots()
103
- plt.title("Frequency of Ball Percepts found in Image")
104
- h = ax.hist2d(
105
- x_list_bottom,
106
- y_list_bottom,
107
- bins=[np.arange(0, 640, 20), np.arange(0, 480, 20)],
108
- )
109
- fig.colorbar(h[3], ax=ax)
110
- plt.savefig("ball_percepts_distribution.png")
@@ -1,22 +0,0 @@
1
- from vaapi.client import Vaapi
2
- from vaapi.types.image import Image
3
- import os
4
-
5
- def get_and_update_img():
6
- imgs = client.image.list(log=282)
7
- imgs_to_update = []
8
- for img in imgs:
9
- #construct image with id and the fields that you want to update
10
- imgs_to_update.append(Image(id=img.id,frame=img.frame.id))
11
- if len(imgs_to_update) == 10:
12
- break
13
- print(imgs_to_update)
14
-
15
- client.image.bulk_update(data=imgs_to_update)
16
-
17
- if __name__ == "__main__":
18
- client = Vaapi(
19
- base_url=os.environ.get("VAT_API_URL"),
20
- api_key=os.environ.get("VAT_API_TOKEN"),
21
- )
22
- get_and_update_img()
@@ -1,21 +0,0 @@
1
- import requests
2
- import os
3
-
4
- def upload_model(files):
5
- response = requests.post(url=f"{base_url[0]}api/upload/model/",files=files,headers=headers)
6
- print(response.text)
7
-
8
- def upload_dataset(files):
9
- response = requests.post(url=f"{base_url[0]}api/upload/dataset/",files=files,headers=headers)
10
- print(response.text)
11
-
12
- if __name__ == "__main__":
13
- base_url=os.environ.get("VAT_API_URL"),
14
- api_key=os.environ.get("VAT_API_TOKEN"),
15
-
16
- # specify a file you want to upload
17
- files = {'file': open('test-upload.h5', 'rb')}
18
- headers ={"Authorization":f"Token {api_key[0]}"}
19
-
20
- upload_model(files)
21
- # upload_dataset(files)