Update README.md
Browse files
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 |
-
|
| 19 |
|
| 20 |
-
#
|
| 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,
|
| 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 |
```
|