質問編集履歴

6

誤字

2021/01/10 09:37

投稿

max12345
max12345

スコア20

test CHANGED
File without changes
test CHANGED
@@ -202,7 +202,7 @@
202
202
 
203
203
  f = f.append(new_name, ignore_index=True)
204
204
 
205
- f.to_csv('C:\Users\user\Desktop\output\valu.csv',index=False,header = True )
205
+ f.to_csv('C:\Users\username\Desktop\output\valu.csv',index=False,header = True )
206
206
 
207
207
 
208
208
 

5

誤字

2021/01/10 09:37

投稿

max12345
max12345

スコア20

test CHANGED
File without changes
test CHANGED
@@ -144,7 +144,7 @@
144
144
 
145
145
  f = f.append(new_name, ignore_index=True)
146
146
 
147
- f.to_csv('C:\Users\nogamitakuma\Desktop\output\valu.csv',index=False,header = True )
147
+ f.to_csv('C:\Users\username\Desktop\output\valu.csv',index=False,header = True )
148
148
 
149
149
 
150
150
 

4

誤字

2021/01/10 09:36

投稿

max12345
max12345

スコア20

test CHANGED
@@ -1 +1 @@
1
- インデントエラーの修正
1
+ aインデントエラーの修正
test CHANGED
@@ -148,7 +148,7 @@
148
148
 
149
149
 
150
150
 
151
- test_data = data_iterator_csv_dataset("C:\Users\nogamitakuma\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
151
+ test_data = data_iterator_csv_dataset("C:\Users\username\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
152
152
 
153
153
 
154
154
 
@@ -166,7 +166,7 @@
166
166
 
167
167
 
168
168
 
169
- nn.load_parameters('\Users\nogamitakuma\Desktop\output\yubidata.files/20210108_180946\results.nnp')
169
+ nn.load_parameters('\Users\username\Desktop\output\yubidata.files/20210108_180946\results.nnp')
170
170
 
171
171
  print("load model")
172
172
 
@@ -202,11 +202,11 @@
202
202
 
203
203
  f = f.append(new_name, ignore_index=True)
204
204
 
205
- f.to_csv('C:\Users\nogamitakuma\Desktop\output\valu.csv',index=False,header = True )
205
+ f.to_csv('C:\Users\user\Desktop\output\valu.csv',index=False,header = True )
206
-
207
-
208
-
206
+
207
+
208
+
209
- test_data = data_iterator_csv_dataset("C:\Users\nogamitakuma\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
209
+ test_data = data_iterator_csv_dataset("C:\Users\username\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
210
210
 
211
211
 
212
212
 
@@ -224,7 +224,7 @@
224
224
 
225
225
 
226
226
 
227
- nn.load_parameters('C:\Users\nogamitakuma\Desktop\output\yubidata.files/20210108_180946\results.nnp')
227
+ nn.load_parameters('C:\Users\username\Desktop\output\yubidata.files/20210108_180946\results.nnp')
228
228
 
229
229
  print("load model")
230
230
 

3

誤字

2021/01/10 09:35

投稿

max12345
max12345

スコア20

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![イメージ説明](92bb6b1c96edff4d9aa6def79a5dddd6.png)
4
4
 
5
-
5
+ ```python
6
6
 
7
7
  import nnabla as nn
8
8
 
@@ -261,3 +261,5 @@
261
261
  cap.release()
262
262
 
263
263
  cv2.destroyAllWindows()
264
+
265
+ ```

2

写真が足りない

2021/01/10 09:34

投稿

max12345
max12345

スコア20

test CHANGED
File without changes
test CHANGED
@@ -84,7 +84,7 @@
84
84
 
85
85
 
86
86
 
87
- cap = cv2.VideoCapture(0)
87
+ cap = cv2.VideoCapture(0) # 任意のカメラ番号に変更する
88
88
 
89
89
 
90
90
 
@@ -94,22 +94,26 @@
94
94
 
95
95
 
96
96
 
97
-
97
+ #カメラスタート
98
98
 
99
99
  while True:
100
100
 
101
+
102
+
101
103
  ret, frame = cap.read()
102
104
 
103
105
  cv2.imshow("camera", frame)
104
106
 
105
107
 
106
108
 
107
- k = cv2.waitKey(1)&0xff
109
+ k = cv2.waitKey(1)&0xff # キー入力を待つ
108
110
 
109
111
  if k == ord('p'):
110
112
 
111
113
 
112
114
 
115
+ # 「p」キーで画像を保存
116
+
113
117
 
114
118
 
115
119
  date = datetime.now().strftime("%Y%m%d_%H%M%S")
@@ -140,17 +144,17 @@
140
144
 
141
145
  f = f.append(new_name, ignore_index=True)
142
146
 
143
- f.to_csv('C:\Users\username\Desktop\output\valu.csv',index=False,header = True )
147
+ f.to_csv('C:\Users\nogamitakuma\Desktop\output\valu.csv',index=False,header = True )
144
-
145
-
146
-
148
+
149
+
150
+
147
- test_data = data_iterator_csv_dataset("C:\Users\username\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
151
+ test_data = data_iterator_csv_dataset("C:\Users\nogamitakuma\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
152
+
153
+
154
+
155
+
156
+
148
-
157
+ #ネットワークの構築
149
-
150
-
151
-
152
-
153
-
154
158
 
155
159
  nn.clear_parameters()
156
160
 
@@ -162,7 +166,7 @@
162
166
 
163
167
 
164
168
 
165
- nn.load_parameters('\Users\username\Desktop\output\yubidata.files/20210108_180946\results.nnp')
169
+ nn.load_parameters('\Users\nogamitakuma\Desktop\output\yubidata.files/20210108_180946\results.nnp')
166
170
 
167
171
  print("load model")
168
172
 
@@ -172,75 +176,75 @@
172
176
 
173
177
 
174
178
 
175
- path = new_dir_path + "test" +".png"
176
-
177
- cv2.imwrite(path, frame)
178
-
179
- image_gs = cv2.imread(path)
180
-
181
-
182
-
183
- path = new_dir_path + date +".png"
184
-
185
- dst = cv2.resize(image_gs,(250,250))
186
-
187
- cv2.imwrite(path, dst)
188
-
189
-
190
-
191
- f = pd.DataFrame(columns=["x:data","y:data"])
192
-
193
- xdata = path
194
-
195
- ydata = 0
196
-
197
- new_name = pd.Series([xdata,ydata],index=f.columns)
198
-
199
- f = f.append(new_name, ignore_index=True)
200
-
201
- f.to_csv('C:\Users\username\Desktop\output\valu.csv',index=False,header = True )
202
-
203
-
204
-
205
- test_data = data_iterator_csv_dataset("C:\Users\username\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
- nn.clear_parameters()      ← ☆ここでインデントエラーがでた
214
-
215
- x = nn.Variable((1,3,250,250))
216
-
217
- t = nn.Variable((1,1))
218
-
219
- y = network(x, t)
220
-
221
-
222
-
223
- nn.load_parameters('C:\Users\username\Desktop\output\yubidata.files/20210108_180946\results.nnp')
224
-
225
- print("load model")
179
+ path = new_dir_path + "test" +".png"
180
+
181
+ cv2.imwrite(path, frame)
182
+
183
+ image_gs = cv2.imread(path)
184
+
185
+
186
+
187
+ path = new_dir_path + date +".png"
188
+
189
+ dst = cv2.resize(image_gs,(250,250))
190
+
191
+ cv2.imwrite(path, dst)
192
+
193
+
194
+
195
+ f = pd.DataFrame(columns=["x:data","y:data"])
196
+
197
+ xdata = path
198
+
199
+ ydata = 0
200
+
201
+ new_name = pd.Series([xdata,ydata],index=f.columns)
202
+
203
+ f = f.append(new_name, ignore_index=True)
204
+
205
+ f.to_csv('C:\Users\nogamitakuma\Desktop\output\valu.csv',index=False,header = True )
206
+
207
+
208
+
209
+ test_data = data_iterator_csv_dataset("C:\Users\nogamitakuma\Desktop\output\valu.csv",1,shuffle=False,normalize=True)
210
+
211
+
212
+
213
+
214
+
215
+ #ネットワークの構築
216
+
217
+ nn.clear_parameters()
218
+
219
+ x = nn.Variable((1,3,250,250))
220
+
221
+ t = nn.Variable((1,1))
222
+
223
+ y = network(x, t)
224
+
225
+
226
+
227
+ nn.load_parameters('C:\Users\nogamitakuma\Desktop\output\yubidata.files/20210108_180946\results.nnp')
228
+
229
+ print("load model")
226
230
 
227
231
 
228
232
 
229
- for i in range(test_data.size):
233
+ for i in range(test_data.size):
230
234
 
231
235
 
232
236
 
233
- x.d, t.d = test_data.next()
237
+ x.d, t.d = test_data.next()
234
-
238
+
235
- y.forward()
239
+ y.forward()
236
-
240
+
237
- print(y.d[0])
241
+ print(y.d[0])
238
242
 
239
243
 
240
244
 
241
245
 
242
246
 
243
- elif
247
+ elif
244
248
 
245
249
  k == ord('q'):
246
250
 
@@ -248,7 +252,7 @@
248
252
 
249
253
 
250
254
 
251
- break
255
+ break
252
256
 
253
257
 
254
258
 

1

写真が足りない

2021/01/10 09:14

投稿

max12345
max12345

スコア20

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  インデントエラーでつまづいています。どういうふうに書き直せば良いのでしょうか。
2
2
 
3
-
3
+ ![イメージ説明](92bb6b1c96edff4d9aa6def79a5dddd6.png)
4
4
 
5
5
 
6
6