未验证 提交 ae6ec401 编写于 作者: M Maxim Zhiltsov 提交者: GitHub

Image copying in CVAT format (#2091)

上级 e52ff96a
......@@ -530,15 +530,16 @@ def _export(dst_file, task_data, anno_callback, save_images=False):
frame_provider = FrameProvider(task_data.db_task.data)
frames = frame_provider.get_frames(
frame_provider.Quality.ORIGINAL,
frame_provider.Type.NUMPY_ARRAY)
frame_provider.Type.BUFFER)
for frame_id, (frame_data, _) in enumerate(frames):
frame_name = task_data.frame_info[frame_id]['path']
if '.' in frame_name:
save_image(osp.join(img_dir, frame_name),
frame_data, jpeg_quality=100, create_dir=True)
else:
save_image(osp.join(img_dir, frame_name + '.png'),
frame_data, create_dir=True)
ext = ''
if not '.' in osp.basename(frame_name):
ext = '.png'
img_path = osp.join(img_dir, frame_name + ext)
os.makedirs(osp.dirname(img_path), exist_ok=True)
with open(img_path, 'wb') as f:
f.write(frame_data.getvalue())
make_zip_archive(temp_dir, dst_file)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册