Spaces:
Sleeping
Sleeping
Update draw_sub_dimension.py
Browse files- draw_sub_dimension.py +18 -17
draw_sub_dimension.py
CHANGED
@@ -16,23 +16,24 @@ def sub_consist_attr(model,high=15,low=1):
|
|
16 |
interval = high - low
|
17 |
score = []
|
18 |
df = pd.read_csv(model)
|
|
|
19 |
|
20 |
color = []
|
21 |
for i in color_indices:
|
22 |
-
for j in range(
|
23 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
24 |
s = float(df.iloc[j, -1])
|
25 |
color.append((s-low)/interval)
|
26 |
|
27 |
shape = []
|
28 |
for i in shape_indices:
|
29 |
-
for j in range(
|
30 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
31 |
s = float(df.iloc[j, -1])
|
32 |
shape.append((s-low)/interval)
|
33 |
texture = []
|
34 |
for i in texture_indices:
|
35 |
-
for j in range(
|
36 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
37 |
s = float(df.iloc[j, -1])
|
38 |
texture.append((s-low)/interval)
|
@@ -60,17 +61,18 @@ def sub_action(model,high=10,low=1):
|
|
60 |
interval = high - low
|
61 |
score = []
|
62 |
df = pd.read_csv(model)
|
|
|
63 |
|
64 |
common = []
|
65 |
for i in common_ind:
|
66 |
-
for j in range(
|
67 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
68 |
s = float(df.iloc[j, -1])
|
69 |
common.append((s-low)/interval)
|
70 |
|
71 |
uncommon = []
|
72 |
for i in uncommon_ind:
|
73 |
-
for j in range(
|
74 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
75 |
s = float(df.iloc[j, -1])
|
76 |
uncommon.append((s-low)/interval)
|
@@ -94,17 +96,18 @@ def sub_interaction(model,high=10,low=1):
|
|
94 |
interval = high - low
|
95 |
score = []
|
96 |
df = pd.read_csv(model)
|
|
|
97 |
|
98 |
physical = []
|
99 |
for i in physical_ind:
|
100 |
-
for j in range(
|
101 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
102 |
s = float(df.iloc[j, -1])
|
103 |
physical.append((s-low)/interval)
|
104 |
|
105 |
social = []
|
106 |
for i in social_ind:
|
107 |
-
for j in range(
|
108 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
109 |
s = float(df.iloc[j, -1])
|
110 |
social.append((s-low)/interval)
|
@@ -136,45 +139,46 @@ def sub_spatial(model):
|
|
136 |
|
137 |
record = {}
|
138 |
df = pd.read_csv(model) # Replace with your CSV file path
|
139 |
-
|
|
|
140 |
scores = df.iloc[:, -1].tolist()
|
141 |
scores = scores[:200]
|
142 |
|
143 |
left = []
|
144 |
for i in left_ind:
|
145 |
-
for j in range(
|
146 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
147 |
s = float(df.iloc[j, -1])
|
148 |
left.append(s)
|
149 |
right = []
|
150 |
for i in right_ind:
|
151 |
-
for j in range(
|
152 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
153 |
s = float(df.iloc[j, -1])
|
154 |
right.append(s)
|
155 |
|
156 |
above = []
|
157 |
for i in above_ind:
|
158 |
-
for j in range(
|
159 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
160 |
s = float(df.iloc[j, -1])
|
161 |
above.append(s)
|
162 |
below = []
|
163 |
for i in below_ind:
|
164 |
-
for j in range(
|
165 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
166 |
s = float(df.iloc[j, -1])
|
167 |
below.append(s)
|
168 |
|
169 |
front = []
|
170 |
for i in front_ind:
|
171 |
-
for j in range(
|
172 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
173 |
s = float(df.iloc[j, -1])
|
174 |
front.append(s)
|
175 |
behind = []
|
176 |
for i in behind_ind:
|
177 |
-
for j in range(
|
178 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
179 |
s = float(df.iloc[j, -1])
|
180 |
behind.append(s)
|
@@ -306,9 +310,6 @@ def sub_motion(model):
|
|
306 |
left_thresh = 5 #5%
|
307 |
up_thresh = 5 #5%
|
308 |
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
distance = []
|
313 |
direction = []
|
314 |
|
|
|
16 |
interval = high - low
|
17 |
score = []
|
18 |
df = pd.read_csv(model)
|
19 |
+
total_videos = df.shape[0] - 1
|
20 |
|
21 |
color = []
|
22 |
for i in color_indices:
|
23 |
+
for j in range(total_videos):
|
24 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
25 |
s = float(df.iloc[j, -1])
|
26 |
color.append((s-low)/interval)
|
27 |
|
28 |
shape = []
|
29 |
for i in shape_indices:
|
30 |
+
for j in range(total_videos):
|
31 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
32 |
s = float(df.iloc[j, -1])
|
33 |
shape.append((s-low)/interval)
|
34 |
texture = []
|
35 |
for i in texture_indices:
|
36 |
+
for j in range(total_videos):
|
37 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
38 |
s = float(df.iloc[j, -1])
|
39 |
texture.append((s-low)/interval)
|
|
|
61 |
interval = high - low
|
62 |
score = []
|
63 |
df = pd.read_csv(model)
|
64 |
+
total_videos = df.shape[0] - 1
|
65 |
|
66 |
common = []
|
67 |
for i in common_ind:
|
68 |
+
for j in range(total_videos):
|
69 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
70 |
s = float(df.iloc[j, -1])
|
71 |
common.append((s-low)/interval)
|
72 |
|
73 |
uncommon = []
|
74 |
for i in uncommon_ind:
|
75 |
+
for j in range(total_videos):
|
76 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
77 |
s = float(df.iloc[j, -1])
|
78 |
uncommon.append((s-low)/interval)
|
|
|
96 |
interval = high - low
|
97 |
score = []
|
98 |
df = pd.read_csv(model)
|
99 |
+
total_videos = df.shape[0] - 1
|
100 |
|
101 |
physical = []
|
102 |
for i in physical_ind:
|
103 |
+
for j in range(total_videos):
|
104 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
105 |
s = float(df.iloc[j, -1])
|
106 |
physical.append((s-low)/interval)
|
107 |
|
108 |
social = []
|
109 |
for i in social_ind:
|
110 |
+
for j in range(total_videos):
|
111 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
112 |
s = float(df.iloc[j, -1])
|
113 |
social.append((s-low)/interval)
|
|
|
139 |
|
140 |
record = {}
|
141 |
df = pd.read_csv(model) # Replace with your CSV file path
|
142 |
+
total_videos = df.shape[0] - 1
|
143 |
+
|
144 |
scores = df.iloc[:, -1].tolist()
|
145 |
scores = scores[:200]
|
146 |
|
147 |
left = []
|
148 |
for i in left_ind:
|
149 |
+
for j in range(total_videos):
|
150 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
151 |
s = float(df.iloc[j, -1])
|
152 |
left.append(s)
|
153 |
right = []
|
154 |
for i in right_ind:
|
155 |
+
for j in range(total_videos):
|
156 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
157 |
s = float(df.iloc[j, -1])
|
158 |
right.append(s)
|
159 |
|
160 |
above = []
|
161 |
for i in above_ind:
|
162 |
+
for j in range(total_videos):
|
163 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
164 |
s = float(df.iloc[j, -1])
|
165 |
above.append(s)
|
166 |
below = []
|
167 |
for i in below_ind:
|
168 |
+
for j in range(total_videos):
|
169 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
170 |
s = float(df.iloc[j, -1])
|
171 |
below.append(s)
|
172 |
|
173 |
front = []
|
174 |
for i in front_ind:
|
175 |
+
for j in range(total_videos):
|
176 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
177 |
s = float(df.iloc[j, -1])
|
178 |
front.append(s)
|
179 |
behind = []
|
180 |
for i in behind_ind:
|
181 |
+
for j in range(total_videos):
|
182 |
if df.iloc[j, 0][:4] == f"{i:04d}":
|
183 |
s = float(df.iloc[j, -1])
|
184 |
behind.append(s)
|
|
|
310 |
left_thresh = 5 #5%
|
311 |
up_thresh = 5 #5%
|
312 |
|
|
|
|
|
|
|
313 |
distance = []
|
314 |
direction = []
|
315 |
|