代码拉取完成,页面将自动刷新
# from feature_extract.REINFORCE_MD import WordBook, ExpressionDescritor
# from img_toolkit.image_tools import get_real_img
import numpy as np
from dataset_toolkit.data_reader import DataFactory
if __name__ == "__main__":
reader = DataFactory.get_data_reader("ck+")
reader.read()
au_max = max(reader.get_all_au())
print(reader.get_all_au())
au = reader.get_imgpath_AU_dict(last_img_num=4)
caffe_file_writer = open("D:/file_list.txt", "w")
for img_path, au_path in au.items():
au_vec = np.zeros(int(au_max))
au_vec -= 1
au_lst = reader.get_real_au(au_path).keys()
for au in au_lst:
au = int(float(au))
np.put(au_vec, au-1, 1)
line = "{0} {1}\n".format(img_path, " ".join(map(str, map(int,au_vec))))
line = line.replace("\\", "/")
caffe_file_writer.write(line)
caffe_file_writer.flush()
caffe_file_writer.close()
# kfold_samples = DataFactory.kfold_video_split("CASME2", 6 , True)
#
# trn_data_set = kfold_samples[0]["trn"]
# test_data_set = kfold_samples[0]["test"]
# book = WordBook(trn_data_set)
# ed = ExpressionDescritor(book)
#
# test_feature_list = []
# for key, video_seq in test_data_set.video_seq.items():
# test_feature_list.append(ed.hist(key, video_seq))
#
# for f in test_feature_list:
# print(f)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。