【问题标题】:Use openpose on videos in google drive on google colab在 google colab 上的 google drive 中的视频上使用 openpose
【发布时间】:2020-05-07 15:24:50
【问题描述】:

我正在使用openpose提取一些视频的骨架结构并在上面运行代码

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

当我将视频从本地上传到 google colab 和 使用openpose,效果很好。

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

但是,当我为我的谷歌驱动器中的视频运行 openpose 时,即使我运行它也不起作用

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

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)

如何在我的谷歌驱动器中的视频上使用 openpose?

【问题讨论】:

  • 您是否使用我在此处提到的身份验证安装驱动器*.com/questions/61428443/…
  • 是的,我确实安装了驱动器,我可以打开我的谷歌驱动器中的每个文件夹和文件。问题是当我使用 openpose 时。

标签: python google-colaboratory openpose


【解决方案1】:

问题是路径名中的空格 '/content/gdrive/我的云端硬盘/videos/'

更改为 '/content/gdrive/My\ Drive/videos/' 会工作的。

【讨论】:

    最近更新 更多