-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.93 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
58
59
60
61
# 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
import os
os.makedirs('ci_artifacts', exist_ok=True)
req = urllib.request.urlopen('https://raw.githubusercontent.com/developer0hye/onepose/main/onepose/assets/sample.png')
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
for model_name in onepose.list_models():
model = onepose.create_model(model_name)
img = cv2.imdecode(arr, cv2.IMREAD_COLOR) # 'Load it as it is'
keypoints = model(img)
num_keypoints = len(keypoints['points'])
pts = keypoints['points']
pts_confidence = keypoints['confidence']
for i in range(num_keypoints):
print(f'Point {i} {model.keypoint_info[i]} (x, y) : {pts[i]} confidence: {pts_confidence[i]}')
onepose.visualize_keypoints(img, keypoints, model.keypoint_info, model.skeleton_info)
cv2.imwrite(f'ci_artifacts/sample_{model_name}_output.png', img)
"
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: outputs
path: ci_artifacts
retention-days: 1