Skip to content

Commit

Permalink
fix conve (PaddlePaddle#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhk-1 authored Jan 2, 2025
1 parent 72e7878 commit d3f85de
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from PIL import Image
from pathlib import Path
from functools import partial
from datacopilot.core import MMDataset
from paddlemix.datacopilot.core import MMDataset
import re
import argparse

def read_json_files(json_root,image_root):
# 创建空列表用于存储字典
Expand Down Expand Up @@ -120,6 +121,6 @@ def convert_scheme(item):
dataset = dataset.filter(_filter_image_hw_ratio).nonempty()
dataset = dataset.map(convert_scheme).nonempty()
print('数据长度',len(dataset))
out_path = os.path.join(image_root, args.json_name)
out_path = os.path.join(image_root, args.output_file)
dataset.export_json(out_path)
print(f"数据保存在 {out_path}")

0 comments on commit d3f85de

Please sign in to comment.