-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.76 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/developer0hye/onepose.git
- name: Test Python
run: |
python -c "
import cv2
import onepose
import urllib
import numpy as np
req = urllib.request.urlopen('https://raw.githubusercontent.com/developer0hye/onepose/main/onepose/assets/sample.png')
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr, cv2.IMREAD_COLOR) # 'Load it as it is'
model = onepose.create_model()
keypoints = model(img)
num_keypoints = len(keypoints['points'])
for i in range(num_keypoints):
print(f"Point {i} {model.keypoint_info[i]} (x, y) : {keypoints['points'][i]} confidence: {keypoints['confidence'][i]}")
onepose.visualize_keypoints(img, keypoints, model.keypoint_info, model.skeleton_info)
os.makedirs("ci_artifacts", exist_ok=True)
cv2.imwrite('ci_artifacts/sample_output.png', img)
"
# - name: upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: outputs
# path: ci_artifacts