From 57eab33ae20f7c75803614688ca739348bc390c1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 29 Nov 2024 16:47:54 +0100 Subject: [PATCH] Fixed strike a pose when there is no confidence --- .../last_known_config.txt | 91 ------------------- demos/strike_a_pose_demo/main.py | 5 +- 2 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 demos/paint_your_dreams_demo/last_known_config.txt diff --git a/demos/paint_your_dreams_demo/last_known_config.txt b/demos/paint_your_dreams_demo/last_known_config.txt deleted file mode 100644 index e5de5ee9..00000000 --- a/demos/paint_your_dreams_demo/last_known_config.txt +++ /dev/null @@ -1,91 +0,0 @@ ---extra-index-url https://download.pytorch.org/whl/cpu - -aiofiles==23.2.1 -aiohappyeyeballs==2.4.3 -aiohttp==3.10.10 -aiosignal==1.3.1 -annotated-types==0.7.0 -anyio==4.6.2.post1 -async-timeout==4.0.3 -attrs==24.2.0 -certifi==2024.8.30 -charset-normalizer==3.4.0 -click==8.1.7 -colorama==0.4.6 -coloredlogs==15.0.1 -datasets==3.0.2 -diffusers==0.31.0 -dill==0.3.8 -exceptiongroup==1.2.2 -fastapi==0.115.3 -ffmpy==0.4.0 -filelock==3.16.1 -frozenlist==1.4.1 -fsspec==2024.9.0 -gradio==5.3.0 -gradio_client==1.4.2 -h11==0.14.0 -httpcore==1.0.6 -httpx==0.27.2 -huggingface-hub==0.26.1 -humanfriendly==10.0 -idna==3.10 -importlib_metadata==8.5.0 -Jinja2==3.1.4 -markdown-it-py==3.0.0 -MarkupSafe==2.1.5 -mdurl==0.1.2 -mpmath==1.3.0 -multidict==6.1.0 -multiprocess==0.70.16 -networkx==3.4.2 -numpy==2.0.2 -onnx==1.16.0 -opencv-python==4.10.0.84 -openvino==2024.4.0 -openvino-telemetry==2024.1.0 -optimum==1.23.2 -optimum-intel==1.20.0 -orjson==3.10.10 -packaging==24.1 -pandas==2.2.3 -pillow==10.4.0 -propcache==0.2.0 -protobuf==5.28.2 -pyarrow==17.0.0 -pydantic==2.9.2 -pydantic_core==2.23.4 -pydub==0.25.1 -Pygments==2.18.0 -pyreadline3==3.5.4 -python-dateutil==2.9.0.post0 -python-multipart==0.0.12 -pytz==2024.2 -PyYAML==6.0.2 -regex==2024.9.11 -requests==2.32.3 -rich==13.9.3 -ruff==0.7.0 -safetensors==0.4.5 -scipy==1.14.1 -semantic-version==2.10.0 -sentencepiece==0.2.0 -shellingham==1.5.4 -six==1.16.0 -sniffio==1.3.1 -starlette==0.41.0 -sympy==1.13.1 -tokenizers==0.20.1 -tomlkit==0.12.0 -torch==2.5.0+cpu -tqdm==4.66.5 -transformers==4.45.2 -typer==0.12.5 -typing_extensions==4.12.2 -tzdata==2024.2 -urllib3==2.2.3 -uvicorn==0.32.0 -websockets==12.0 -xxhash==3.5.0 -yarl==1.16.0 -zipp==3.20.2 diff --git a/demos/strike_a_pose_demo/main.py b/demos/strike_a_pose_demo/main.py index 8c1d75b6..2be312d6 100644 --- a/demos/strike_a_pose_demo/main.py +++ b/demos/strike_a_pose_demo/main.py @@ -57,8 +57,9 @@ def load_and_compile_model(model_path: Path, device: str) -> YOLO: def draw_poses(img: np.ndarray, detections: Results, point_score_threshold: float = 0.5, skeleton: Tuple[Tuple[int, int]] = default_skeleton): - poses = detections.keypoints.xy.numpy() - scores = detections.keypoints.conf.numpy() + keypoints = detections.keypoints + poses = keypoints.xy.numpy() + scores = keypoints.conf.numpy() if keypoints.conf is not None else np.ones_like(poses[..., 0]) if len(poses) == 0: return img