首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在google colab的google drive中对视频使用openpose

在google colab的google drive中对视频使用openpose
EN

Stack Overflow用户
提问于 2020-04-29 23:27:01
回答 1查看 480关注 0票数 0

我正在使用openpose来提取一些视频的骨架结构,并在

google colab获得更好的硬件条件。

当我从本地上传视频到google colab并使用openpose时,它工作得很好。

我想使用google drive观看更多视频,所以我将google drive连接到了colab。

然而,当我为google drive中的视频运行openpose时,它无法工作,即使我

使用了完全相同的代码,除了视频的路径。

代码语言:javascript
复制
import subprocess

VideoPath = '/content/videos/'    #works perfectly as I expected
#VideoPath = '/content/gdrive/My Drive/videos/'   #does not work

if not os.path.exists("/content/output/"):
  os.mkdir("/content/output/")

for video in os.listdir(VideoPath):
  VideoName = video[:-4]

  InputVideo = VideoPath + video
  OutputDir = "/content/output2/output_" + VideoName + "/"

  if not os.path.exists("/content/output/output_" + VideoName):
    os.mkdir("/content/output/output_" + VideoName)

  pipe = subprocess.call("cd /content/openpose && /content/openpose/build/examples/openpose/openpose.bin --video " + InputVideo + " --write_json " + OutputDir + " --display 0 --render_pose 0 --face --hand", shell=True)

如何在我的google drive中对视频使用openpose?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-07 15:24:50

问题出在路径名“/content/gdrive/My Drive/videos/”中的空格

更改为“/content/gdrive/My\Drive/videos/”将起作用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61505485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档