nielsr HF Staff commited on
Commit
c405646
·
1 Parent(s): 0e90384

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -6
README.md CHANGED
@@ -15,12 +15,9 @@ vr = VideoReader(file_path, num_threads=1, ctx=cpu(0))
15
  # get 16 frames
16
  vr.seek(0)
17
  indices = [164 168 172 176 181 185 189 193 198 202 206 210 215 219 223 227]
18
- buffer = vr.get_batch(indices).asnumpy()
19
 
20
- # create a list of NumPy arrays
21
- video = [buffer[i] for i in range(buffer.shape[0])]
22
-
23
- video_numpy = np.array(video)
24
  with open('eating_spaghetti.npy', 'wb') as f:
25
- np.save(f, video_numpy)
26
  ```
 
15
  # get 16 frames
16
  vr.seek(0)
17
  indices = [164 168 172 176 181 185 189 193 198 202 206 210 215 219 223 227]
18
+ video = vr.get_batch(indices).asnumpy()
19
 
20
+ # save as NumPy array
 
 
 
21
  with open('eating_spaghetti.npy', 'wb') as f:
22
+ np.save(f, video)
23
  ```