Comments (1)
I rewrote the code for generating videos, which might be helpful for you.
import cv2
import os
import glob
from tqdm import tqdm
# images route
root_path = os.path.abspath("./results_img")
# output vedio route
video_save_path = os.path.abspath("./frame2vedio")
def generateVedio(name_list):
global video_save_path
for i in tqdm(range(len(name_list))):
person_name = name_list[i]
frame_path = root_path + "/" + person_name
image_files = glob.glob(frame_path + "/*.jpg")
image_files.sort(key=lambda x: int(os.path.splitext(os.path.basename(x))[0].split("_")[-1]))
size = (2304, 1440)
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
# 20 is the FPS, you can change it
videowrite = cv2.VideoWriter(video_save_path + "/" + person_name + ".mp4", fourcc, 20, size)
img_array = []
for filename in image_files:
img = cv2.imread(filename)
img_array.append(img)
for j in range(len(image_files)):
videowrite.write(img_array[j])
print("视频{0}.mp4生成完毕!".format(person_name))
if __name__ == "__main__":
name_list = os.listdir(root_path)
print(name_list)
generateVedio(name_list)
Add something like this in demo_camera.py cv2.imwrite('results_img/demo2/demo2_{}.jpg'.format(i), canvas)
in order to reserve the images in a folder.
from pytorch-openpose.
Related Issues (20)
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- How can I get one person date,not multi? HOT 8
- 'Digraph' object has no attribute '_repr_svg_' in network_graph.ipynb
- 样例代码里面,有个candidate字段无法解析。
- Hardware requirements for running in real time?
- PCK AP
- Why do you need to add 1 here?
- followed instruction, tried to run"python demo.py" ,get "Segmentation fault( core dumped)" HOT 1
- python demo_video.py "****.mp4" occurs to error called OSFailed HOT 2
- What values are in the paf and heatmap?
- FileNotFoundError: [WinError 2] 系统找不到指定的文件。 HOT 7
- how to generate the graph like this? HOT 2
- Keypoint confidence score
- 单手识别效果是否会收到handdetect函数的影响?
- Environment Setup (running succesful!) HOT 2
- Typos, some significantly affecting performance HOT 1
- GPU使用率
- Implement the 3D construction module of open pose
- Request for License Information
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-openpose.