@naptat (a-pancake)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Google ColaboratoryでのOpenpose実行

解決したいこと

Google ColaboratoryでOpenposeを実行しようとしますがエラーで困っています

参考にさせて頂いたブログです
http://cedro3.com/ai/openpose/

発生している問題・エラー

File "<ipython-input-33-33a4b59c3e3d>", line 1
    ./build/examples/openpose/openpose.bin --video /content/drive/MyDrive/tech1.mp4 --write-video /content/drive/MyDrive/ --write-json /content/drive/MyDrive/
    ^
SyntaxError: invalid syntax

以下のスクリプトからOpenposeの環境構築を試みました

import os
from os.path import exists, join, basename, splitext

git_repo_url = 'https://github.com/CMU-Perceptual-Computing-Lab/openpose.git'
project_name = splitext(basename(git_repo_url))[0]
if not exists(project_name):
  # see: https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/949
  # install new CMake becaue of CUDA10
  !wget -q https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.tar.gz
  !tar xfz cmake-3.13.0-Linux-x86_64.tar.gz --strip-components=1 -C /usr/local
  # clone openpose
  !git clone -q --depth 1 $git_repo_url
  !sed -i 's/execute_process(COMMAND git checkout master WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/execute_process(COMMAND git checkout f019d0dfe86f49d1140961f8c7dec22130c83154 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/g' openpose/CMakeLists.txt
  # install system dependencies
  !apt-get -qq install -y libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev opencl-headers ocl-icd-opencl-dev libviennacl-dev
  # install python dependencies
  !pip install -q youtube-dl
  # build openpose
  !cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j`nproc`

下記のスクリプトからドライブをマウントしました

from google.colab import drive
drive.mount('/content/drive')

自分で試したこと

動画ファイルまでのパスを確認したりしましたが何度試しても上記のエラーが出ます
上記のエラーは調べたところ文法の間違いであると出てきましたが、どのように間違っているか分かりませんでした
何かアドバイス頂きたいです
よろしくお願いします

0 likes

No Answers yet.

Your answer might help someone💌