Skip to content

Commit 944209a

Browse files
committed
update 更新打包模块
1 parent 4e419bd commit 944209a

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

dataset_tools/jade_voc_datasets.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from opencv_tools import *
1111
from xml.dom import minidom
1212
from dataset_tools import *
13+
from opencv_tools import *
1314
def GetXmlClassesNames(xml_path):
1415
classnames = []
1516
# Read the XML annotation file.
@@ -261,6 +262,20 @@ def video_to_voc(self,save_path,detector=None,fps=5):
261262
index = index + 1
262263
processBar.update()
263264

265+
def paddle_pretrain_detection_dataset(root_path,detector,threshold=0.6):
266+
image_path = os.path.join(root_path,DIRECTORY_IMAGES)
267+
save_anno_path = CreateSavePath(os.path.join(root_path,DIRECTORY_ANNOTATIONS))
268+
image_path_list = GetAllImagesPath(os.path.join(image_path))
269+
processBar = ProgressBar(len(image_path_list))
270+
for image_path in image_path_list:
271+
file_name = GetLastDir(image_path).split(".")[0]
272+
image = ReadChinesePath(image_path)
273+
result = detector.predict(image,threshold)
274+
if result["labels"][0] == -1:
275+
GenerateXml(file_name,image.shape,[],[],save_anno_path)
276+
else:
277+
GenerateXml(file_name,image.shape,result["boxes"],result["labels"],save_anno_path)
278+
processBar.update()
264279

265280
if __name__ == '__main__':
266281
jadeVOCDatasets = JadeVOCDatasets(r'F:\数据集\VOC数据集\定制版顶相机箱号检测数据集')

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#removeNolabelDatasets(r"F:\数据集\关键点检测数据集\定制版箱号关键点数据集\2022-03-09")
1515
#create_text_detection_datasets(r"F:\数据集\关键点检测数据集\定制版箱号关键点数据集",r"E:\Data\字符检测识别数据集\定制版箱号关键点数据集",0.95)
1616
#CreatePaddleOCRDatasets(root_path="E:\Data\字符检测识别数据集\镇江大港厂内车牌关键点检测数据集", save_path="E:\Data\OCR\镇江大港厂内车牌识别数据集",dataset_type="镇江厂内车牌数据集")
17-
#removeNolabelVocDatasets(r"E:\Data\VOC数据集\箱门检测数据集")
18-
CreateYearsDatasets(r"E:\Data\VOC数据集\箱门检测数据集\ContainVOC")
17+
removeNolabelVocDatasets(r"E:\Data\VOC数据集\集装箱残损检测数据集")
18+
CreateYearsDatasets(r"E:\Data\VOC数据集\集装箱残损检测数据集")
1919
#create_text_detection_datasets(r"F:\数据集\关键点检测数据集\箱号关键点数据集",r'E:\Data\字符检测识别数据集\箱号关键点数据集')
2020
#CreatePaddleOCRDatasets(r'E:\Data\字符检测识别数据集\箱号关键点数据集', save_path="E:\Data\OCR\箱号识别数据集",dataset_type="箱号数据集")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setup(
1515
name="dataset_tools",
16-
version="1.0.1",
16+
version="1.0.3",
1717
keywords=("pip", "dataset_tools", ""),
1818
description="dataset_tools",
1919
long_description="",

0 commit comments

Comments
 (0)