问题描述
我是Mediapipe的新手。我已在Windows计算机上安装了具有以下说明(https://google.github.io/mediapipe/getting_started/install.html#installing-on-windows)的最新版本的Mediapipe。我和我的朋友在他使用Ubuntu发行版的另一台机器上尝试相同的代码库。单击带有input_video_path和output_video_path的gui按钮时,hand_mediapipe()执行
def hand_mediapipe(self):
cmd = 'mediapipe//examples//desktop//multi_hand_tracking//multi_hand_tracking_cpu --calculator_graph_config_file=mediapipe/graphs/hand_tracking/multi_hand_tracking_desktop_live.pbtxt'
input_data_path = self.inputfilepathText.get()
output_data_path = self.outputfilepathText.get()
if input_data_path[-1] != '/':
input_data_path = input_data_path+'/'
if output_data_path[-1] != '/':
output_data_path = output_data_path+'/'
listfile = os.listdir(input_data_path) #E:/asl/mediapipe/input # ['inpu.mp4','input_karima.mp4','test']
if not (os.path.isdir(output_data_path + "Relative/")):
os.mkdir(output_data_path + "Relative/")
if not (os.path.isdir(output_data_path + "Absolute/")):
os.mkdir(output_data_path + "Absolute/")
for file in listfile:
if not (os.path.isdir(input_data_path + file)): # ignore .DS_Store
continue
word = file + "/"
fullfilename = os.listdir(input_data_path + word)
if not (os.path.isdir(output_data_path + "_" + word)):
os.mkdir(output_data_path + "_" + word)
if not (os.path.isdir(output_data_path + "Relative/" + word)):
os.mkdir(output_data_path + "Relative/" + word)
if not (os.path.isdir(output_data_path + "Absolute/" + word)):
os.mkdir(output_data_path + "Absolute/" + word)
for mp4list in fullfilename:
if ".DS_Store" in mp4list:
continue
inputfilen = ' --input_video_path="' + input_data_path + word + mp4list + '"'
outputfilen = ' --output_video_path="' + output_data_path + '_' + word + mp4list + '"'
cmdret = cmd + inputfilen + outputfilen
print(cmdret)
os.system("set GLOG_logtostderr=1")
os.system(cmdret)
ubuntu机器上的相同代码将转换视频文件并创建两个目录,并将地标数据保存到文本文件中。但是Windows机器上的相同代码只是成功地转换了视频文件,还创建了文件夹,但是地标文本文件没有为Windows机器保存。我不知道这是怎么回事。我们使用相同的配置构建multi_hand_tracking媒体管道。知道这里有什么问题吗?
文件结构
Ubuntu
Input:
-------->input/test/sample.mp4
output:
├───Absolute
│ └───test
│ sample.txt
│
├───Relative
│ └───test
│ sample.txt
│
└───_test
sample.mp4
Windows
Input:
-------->input/test/sample.mp4
output:
├───Absolute
│ └───test
│
│
├───Relative
│ └───test
│
│
└───_test
sample.mp4
Sample.txt(绝对值)
0.690056 0.660626 0.668767 0.659288 0.655708 0.684498 0.722385 0.710897 0.74826 0.711483 0.759795
0.704865 0.761884 0.682439 0.748338 0.706351 0.7732 0.704937 0.787608 0.700457 0.788169 0.676101
0.774094 0.69607 0.794934 0.693735 0.802731 0.688729 0.800117 0.667059 0.797157 0.67901 0.813903
0.678262 0.815245 0.675491 0.812438 0.601026 0.726457 0.620989 0.70648 0.64043 0.697698 0.657785
0.70095 0.670166 0.713812 0.657251 0.666411 0.690057 0.667365 0.708212 0.677021 0.720562 0.684839
Sample.txt(相对)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 0 -1 1 -1 1
-1 0 -1 1 -1 1 -1 1 -1 0 -1 -1 -1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 1 -1 1 -1 -1 0 -1 1 -1 1 -1 1
-1 -1 -1 0 -1 1 -1 1 -1 -1 -1 0 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
知道我实际上在想什么吗?
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)