-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbad_apple.py
More file actions
32 lines (28 loc) · 921 Bytes
/
Copy pathbad_apple.py
File metadata and controls
32 lines (28 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import cv2
import os
import gzip
# video = cv2.VideoCapture('bad_apple_ingredients/bad_apple.mp4')
# try:
# if not os.path.exists('bad_apple_output'):
# os.makedirs('bad_apple_output')
# except OSError:
# print ('Error')
# currentframe = 0
# while(True):
# ret,frame = video.read()
# if ret:
# name = 'bad_apple_output/' + str(currentframe) + '.jpg'
# print ('Captured...' + name)
# cv2.imwrite(name, frame)
# currentframe += 1
# else:
# break
# video.release()
# cv2.destroyAllWindows()
with gzip.open('bad_apple_ingredients/test_0.nbt', 'r+b') as f, gzip.open('bad_apple_ingredients/test_1.nbt', 'rb') as g:
# with open('bad_apple_output/output.txt','r+') as txt:
# print(f.read(), file=t.xt)
# with open('bad_apple_output/output2.txt','r+') as txt:
# print(g.read(), file=txt)
with gzip.open('bad_apple_output/output_nbt.nbt','wb+') as nbt:
nbt.write(f.read())