FangSen9000 commited on
Commit ·
b0cc904
1
Parent(s): 3308688
Update StableSigner3 repository structure and add Git LFS tracking
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- README.md +7 -163
- assets/WLASL_01214/crop_frame/00000001.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000002.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000003.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000004.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000005.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000006.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000007.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000008.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000009.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000010.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000011.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000012.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000013.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000014.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000015.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000016.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000017.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000018.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000019.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000020.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000021.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000022.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000023.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000024.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000025.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000026.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000027.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000028.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000029.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000030.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000031.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000032.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000033.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000034.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000035.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000036.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000037.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000038.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000039.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000040.jpg +0 -0
- assets/WLASL_01214/crop_frame/00000041.jpg +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000001.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000002.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000003.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000004.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000005.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000006.png +0 -0
- assets/WLASL_01214/dwpose_overlay_img/00000007.png +0 -0
.gitattributes
CHANGED
|
@@ -10,3 +10,5 @@
|
|
| 10 |
*.avi filter=lfs diff=lfs merge=lfs -text
|
| 11 |
*.mov filter=lfs diff=lfs merge=lfs -text
|
| 12 |
*.gif filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 10 |
*.avi filter=lfs diff=lfs merge=lfs -text
|
| 11 |
*.mov filter=lfs diff=lfs merge=lfs -text
|
| 12 |
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,170 +1,14 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
##
|
| 8 |
|
| 9 |
-
##
|
| 10 |
|
| 11 |
-
```bash
|
| 12 |
-
pip install easy-dwpose
|
| 13 |
-
```
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
##
|
| 18 |
-
|
| 19 |
-
```python
|
| 20 |
-
import torch
|
| 21 |
-
from PIL import Image
|
| 22 |
-
import numpy as np
|
| 23 |
-
import json
|
| 24 |
-
|
| 25 |
-
from easy_dwpose import DWposeDetector
|
| 26 |
-
|
| 27 |
-
#####---------Setup init
|
| 28 |
-
# You can use a different GPU, e.g. "cuda:1"
|
| 29 |
-
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 30 |
-
detector = DWposeDetector(device=device)
|
| 31 |
-
input_image = Image.open("assets/pose.png").convert("RGB")
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
#####---------Get both the skeleton image
|
| 35 |
-
# SF: skeleton should be a kind of img
|
| 36 |
-
skeleton = detector(input_image, output_type="pil", include_hands=True, include_face=True)
|
| 37 |
-
# Save the skeleton image
|
| 38 |
-
skeleton.save("skeleton.png")
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
#####---------Get pose data
|
| 42 |
-
# SF: pose_data should be numpy/tensor
|
| 43 |
-
# # This returns the dictionary
|
| 44 |
-
pose_data = detector(input_image, draw_pose=False)
|
| 45 |
-
|
| 46 |
-
# Save the skeleton pose information:
|
| 47 |
-
# Option 1: Save as NPY file
|
| 48 |
-
np.save('pose_data.npy', pose_data)
|
| 49 |
-
|
| 50 |
-
# Option 2: Save as NPZ file
|
| 51 |
-
np.savez('pose_data.npz', **pose_data)
|
| 52 |
-
|
| 53 |
-
# Option 3: Save as JSON file
|
| 54 |
-
# Convert numpy arrays to lists for JSON serialization
|
| 55 |
-
pose_data_json = {k: v.tolist() if isinstance(v, np.ndarray) else v for k, v in pose_data.items()}
|
| 56 |
-
with open('pose_data.json', 'w') as f:
|
| 57 |
-
json.dump(pose_data_json, f)
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
<table align="center">
|
| 61 |
-
<tr>
|
| 62 |
-
<th align="center">Input</th>
|
| 63 |
-
<th align="center">Output</th>
|
| 64 |
-
</tr>
|
| 65 |
-
<tr>
|
| 66 |
-
<td align="center">
|
| 67 |
-
<br />
|
| 68 |
-
<img src="./assets/pose.png"/>
|
| 69 |
-
</td>
|
| 70 |
-
<td align="center">
|
| 71 |
-
<br/>
|
| 72 |
-
<img src="./assets/skeleton.png"/>
|
| 73 |
-
</td>
|
| 74 |
-
</tr>
|
| 75 |
-
</table>
|
| 76 |
-
|
| 77 |
-
### On a video
|
| 78 |
-
|
| 79 |
-
```bash
|
| 80 |
-
python scripts/inference_on_video.py --input assets/dance.mp4 --output_path result.mp4
|
| 81 |
-
```
|
| 82 |
-
|
| 83 |
-
<table align="center">
|
| 84 |
-
<tr>
|
| 85 |
-
<th align="center">Input</th>
|
| 86 |
-
<th align="center">Output</th>
|
| 87 |
-
</tr>
|
| 88 |
-
<tr>
|
| 89 |
-
<td align="center">
|
| 90 |
-
<br />
|
| 91 |
-
<img src="./assets/dance.gif"/>
|
| 92 |
-
</td>
|
| 93 |
-
<td align="center">
|
| 94 |
-
<br/>
|
| 95 |
-
<img src="./assets/skeleton.gif"/>
|
| 96 |
-
</td>
|
| 97 |
-
</tr>
|
| 98 |
-
</table>
|
| 99 |
-
|
| 100 |
-
### On a folder of images
|
| 101 |
-
|
| 102 |
-
```bash
|
| 103 |
-
python scripts/inference_on_folder.py --input assets/ --output_path results/
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
### Easy-DWPose Custom skeleton drawing
|
| 107 |
-
|
| 108 |
-
By default, we use standart skeleton drawing function but several projects change it (e.g. [MusePose](https://github.com/TMElyralab/MusePose)). Modify it or write your own from scratch!
|
| 109 |
-
|
| 110 |
-
```python
|
| 111 |
-
from PIL import Image
|
| 112 |
-
from easy_dwpose import DWposeDetector
|
| 113 |
-
from easy_dwpose.draw.musepose import draw_pose as draw_pose_musepose
|
| 114 |
-
|
| 115 |
-
detector = DWposeDetector(device="cpu")
|
| 116 |
-
input_image = Image.open("assets/pose.png").convert("RGB")
|
| 117 |
-
|
| 118 |
-
skeleton = detector(input_image, output_type="pil", draw_pose=draw_pose_musepose, draw_face=False)
|
| 119 |
-
skeleton.save("skeleton.png")
|
| 120 |
-
```
|
| 121 |
-
|
| 122 |
-
### SF Custom skeleton drawing
|
| 123 |
-
|
| 124 |
-
I prefer ControlNext style, I have developed a visualization method and placed it in `./easy_dwpose/draw/controlnext.py`. It does not integrate with easy dwpose and the calling method is slightly different:
|
| 125 |
-
|
| 126 |
-
```python
|
| 127 |
-
import torch
|
| 128 |
-
from PIL import Image
|
| 129 |
-
import numpy as np
|
| 130 |
-
import json
|
| 131 |
-
|
| 132 |
-
from easy_dwpose import DWposeDetector
|
| 133 |
-
from easy_dwpose.draw.controlnext import draw_pose, process_pose_data
|
| 134 |
-
|
| 135 |
-
#####---------Setup init
|
| 136 |
-
# You can use a different GPU, e.g. "cuda:1"
|
| 137 |
-
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 138 |
-
detector = DWposeDetector(device=device)
|
| 139 |
-
input_image = Image.open("assets/pose.png").convert("RGB")
|
| 140 |
-
|
| 141 |
-
#####---------Custom ControlNext drawing style
|
| 142 |
-
# Get pose data for custom drawing
|
| 143 |
-
pose_data = detector(input_image, draw_pose=False)
|
| 144 |
-
|
| 145 |
-
# Get image dimensions
|
| 146 |
-
width, height = input_image.size
|
| 147 |
-
|
| 148 |
-
# Process the pose data for custom drawing
|
| 149 |
-
processed_pred = process_pose_data(pose_data, height, width)
|
| 150 |
-
|
| 151 |
-
# Draw pose using custom ControlNext style
|
| 152 |
-
vis_img = draw_pose(
|
| 153 |
-
pose=processed_pred,
|
| 154 |
-
H=height,
|
| 155 |
-
W=width,
|
| 156 |
-
include_body=True,
|
| 157 |
-
include_hand=True,
|
| 158 |
-
include_face=True
|
| 159 |
-
)
|
| 160 |
-
|
| 161 |
-
# Convert to PIL Image and save (vis_img is in CHW format)
|
| 162 |
-
custom_skeleton = Image.fromarray(vis_img.transpose(1, 2, 0))
|
| 163 |
-
custom_skeleton.save("skeleton_controlnext.png")
|
| 164 |
-
```
|
| 165 |
-
|
| 166 |
-
## Acknowledgement
|
| 167 |
-
|
| 168 |
-
We thank the original authors of the [DWPose](https://github.com/IDEA-Research/DWPose) for their incredible models!
|
| 169 |
-
|
| 170 |
-
Thanks for open-sourcing!
|
|
|
|
| 1 |
+
# For developers
|
| 2 |
|
| 3 |
+
## tutorial00 Use DWpose to preprocess the original sign language video
|
| 4 |
|
| 5 |
+
## tutorial01 prepare pose dict
|
| 6 |
|
| 7 |
+
## tutorial02 get pose video from text input
|
| 8 |
|
| 9 |
+
## tutorial03 render pose video
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# For Users
|
| 13 |
|
| 14 |
+
## start00 just start as a user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/WLASL_01214/crop_frame/00000001.jpg
DELETED
|
Binary file (8.65 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000002.jpg
DELETED
|
Binary file (8.65 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000003.jpg
DELETED
|
Binary file (8.6 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000004.jpg
DELETED
|
Binary file (8.58 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000005.jpg
DELETED
|
Binary file (8.58 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000006.jpg
DELETED
|
Binary file (8.56 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000007.jpg
DELETED
|
Binary file (8.45 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000008.jpg
DELETED
|
Binary file (8.41 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000009.jpg
DELETED
|
Binary file (8.43 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000010.jpg
DELETED
|
Binary file (8.5 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000011.jpg
DELETED
|
Binary file (8.34 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000012.jpg
DELETED
|
Binary file (8.3 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000013.jpg
DELETED
|
Binary file (8.41 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000014.jpg
DELETED
|
Binary file (8.21 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000015.jpg
DELETED
|
Binary file (8.32 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000016.jpg
DELETED
|
Binary file (8.52 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000017.jpg
DELETED
|
Binary file (8.44 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000018.jpg
DELETED
|
Binary file (8.49 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000019.jpg
DELETED
|
Binary file (8.69 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000020.jpg
DELETED
|
Binary file (8.53 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000021.jpg
DELETED
|
Binary file (8.6 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000022.jpg
DELETED
|
Binary file (8.78 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000023.jpg
DELETED
|
Binary file (8.61 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000024.jpg
DELETED
|
Binary file (8.7 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000025.jpg
DELETED
|
Binary file (8.68 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000026.jpg
DELETED
|
Binary file (8.75 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000027.jpg
DELETED
|
Binary file (8.65 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000028.jpg
DELETED
|
Binary file (8.65 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000029.jpg
DELETED
|
Binary file (8.66 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000030.jpg
DELETED
|
Binary file (8.68 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000031.jpg
DELETED
|
Binary file (8.64 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000032.jpg
DELETED
|
Binary file (8.57 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000033.jpg
DELETED
|
Binary file (8.64 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000034.jpg
DELETED
|
Binary file (8.67 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000035.jpg
DELETED
|
Binary file (8.62 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000036.jpg
DELETED
|
Binary file (8.62 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000037.jpg
DELETED
|
Binary file (8.64 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000038.jpg
DELETED
|
Binary file (8.69 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000039.jpg
DELETED
|
Binary file (8.63 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000040.jpg
DELETED
|
Binary file (8.59 kB)
|
|
|
assets/WLASL_01214/crop_frame/00000041.jpg
DELETED
|
Binary file (8.56 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000001.png
DELETED
|
Binary file (35.1 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000002.png
DELETED
|
Binary file (35.3 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000003.png
DELETED
|
Binary file (35.4 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000004.png
DELETED
|
Binary file (35.5 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000005.png
DELETED
|
Binary file (35.6 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000006.png
DELETED
|
Binary file (35.6 kB)
|
|
|
assets/WLASL_01214/dwpose_overlay_img/00000007.png
DELETED
|
Binary file (35.3 kB)
|
|
|