我正在使用openpose来提取一些视频的骨架结构,并在
google colab获得更好的硬件条件。
当我从本地上传视频到google colab并使用openpose时,它工作得很好。
我想使用google drive观看更多视频,所以我将google drive连接到了colab。
然而,当我为google drive中的视频运行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)如何在我的google drive中对视频使用openpose?
发布于 2020-05-07 15:24:50
问题出在路径名“/content/gdrive/My Drive/videos/”中的空格
更改为“/content/gdrive/My\Drive/videos/”将起作用。
https://stackoverflow.com/questions/61505485
复制相似问题