-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
YangLiu
authored
Jul 29, 2021
1 parent
23b6ce1
commit 26b6ab4
Showing
4 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
jumping in place | ||
jumping jacks | ||
bending | ||
punching | ||
waving two hands | ||
waving one hand | ||
clapping hands | ||
throwing a ball | ||
sit down then stand up | ||
sit down | ||
stand up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from gensim.scripts.glove2word2vec import glove2word2vec | ||
from gensim.models import KeyedVectors | ||
import gensim | ||
import numpy as np | ||
|
||
UTD_Class = [] | ||
MMAct_Class = [] | ||
Berkeley_Class = [] | ||
|
||
for line in open("UTD.txt","r"): #设置文件对象并读取每一行文件 | ||
UTD_Class.append(line[:-1]) | ||
for line in open("MMAct.txt","r"): #设置文件对象并读取每一行文件 | ||
MMAct_Class.append(line[:-1]) | ||
for line in open("Berkeley.txt","r"): #设置文件对象并读取每一行文件 | ||
Berkeley_Class.append(line[:-1]) | ||
|
||
glove_input_file = "glove.840B.300d.txt" | ||
word2vec_output_file="glove.840B.300d.word2vec.txt" | ||
(count, dimensions) = glove2word2vec(glove_input_file, word2vec_output_file) | ||
print(count, '\n', dimensions) | ||
|
||
glove_model = KeyedVectors.load_word2vec_format(word2vec_output_file,binary=False) | ||
|
||
|
||
UTD_vec=np.zeros(shape=[1,300],dtype=float) | ||
for i in range(0,len(UTD_Class)): | ||
UTD_vec_data=np.zeros((1,300),dtype=float) | ||
for data in UTD_Class[i].split(): | ||
UTD_vec_data=UTD_vec_data+glove_model[data] | ||
#UTD_vec_data=UTD_vec_data/len(UTD_Class[i].split()) | ||
UTD_vec=np.vstack((UTD_vec,UTD_vec_data)) | ||
UTD_vec=UTD_vec[1:,:] | ||
np.save('UTD_Glove.npy',UTD_vec) | ||
|
||
|
||
|
||
MMAct_vec=np.zeros(shape=[1,300],dtype=float) | ||
for i in range(0,len(MMAct_Class)): | ||
MMAct_vec_data=np.zeros((1,300),dtype=float) | ||
for data in MMAct_Class[i].split(): | ||
MMAct_vec_data=MMAct_vec_data+glove_model[data] | ||
#MMAct_vec_data=MMAct_vec_data/len(MMAct_Class[i].split()) | ||
MMAct_vec=np.vstack((MMAct_vec,MMAct_vec_data)) | ||
MMAct_vec=MMAct_vec[1:,:] | ||
np.save('MMAct_Glove.npy',MMAct_vec) | ||
|
||
|
||
Berkeley_vec=np.zeros(shape=[1,300],dtype=float) | ||
for i in range(0,len(Berkeley_Class)): | ||
Berkeley_vec_data=np.zeros((1,300),dtype=float) | ||
for data in Berkeley_Class[i].split(): | ||
Berkeley_vec_data=Berkeley_vec_data+glove_model[data] | ||
#Berkeley_vec_data=Berkeley_vec_data/len(Berkeley_Class[i].split()) | ||
Berkeley_vec=np.vstack((Berkeley_vec,Berkeley_vec_data)) | ||
Berkeley_vec=Berkeley_vec[1:,:] | ||
np.save('Berkeley_Glove.npy',Berkeley_vec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
carrying | ||
carrying heavy | ||
carrying light | ||
checking time | ||
closing | ||
crouching | ||
drinking | ||
entering | ||
exiting | ||
fall | ||
jumping | ||
kicking | ||
loitering | ||
looking around | ||
object transfering | ||
opening | ||
picking up | ||
pocket in | ||
pocket out | ||
pointing | ||
pulling | ||
pushing | ||
running | ||
setting down | ||
sitting | ||
sitting down | ||
standing | ||
standing up | ||
talking | ||
talking on phone | ||
throwing | ||
transferring large object | ||
using pc | ||
using phone | ||
walking | ||
waving hand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
right arm swipe to the left | ||
right arm swipe to the right | ||
right hand wave | ||
two hand front clap | ||
right arm throw | ||
cross arms in the chest | ||
basketball shoot | ||
right hand draw x | ||
right hand draw circle clockwise | ||
right hand draw circle counter clockwise | ||
draw triangle | ||
bowling right hand | ||
front box | ||
baseball swing from right | ||
tennis right hand forehand swing | ||
arm curl two arms | ||
tennis serve | ||
two hand push | ||
right hand knock on door | ||
right hand catch an object | ||
right hand pick up and throw | ||
jogging in place | ||
walking in place | ||
sit to stand | ||
stand to sit | ||
forward lunge left foot forward | ||
squat two arms stretch out |