1. 修改字符
parent
a521ccb844
commit
db88494e41
|
|
@ -0,0 +1 @@
|
|||
import os
|
||||
|
|
@ -305,16 +305,16 @@ def getMJSignal(geoExtend,shipPortTree):
|
|||
# pass
|
||||
# 处理软件
|
||||
if MLCFlag and JLCFlag:
|
||||
return MJLCName
|
||||
return "mix_airport"
|
||||
# tiffLCPort[MJLCName].append(tiffpath)
|
||||
elif MLCFlag:
|
||||
return MLCName
|
||||
return "civil_harbor"
|
||||
# tiffLCPort[MLCName].append(tiffpath)
|
||||
elif JLCFlag:
|
||||
return JLCName
|
||||
return "military_harbor"
|
||||
# tiffLCPort[JLCName].append(tiffpath)
|
||||
else:
|
||||
return NOLCName
|
||||
return "no_harbor"
|
||||
# tiffLCPort[NOLCName].append(tiffpath)
|
||||
# return MLCFlag,JLCFlag
|
||||
|
||||
|
|
@ -418,8 +418,8 @@ def getParams():
|
|||
parser.add_argument('-i','--infile',type=str,default=r'D:\港口\港口\Geo_bc2-sm-org-vv-20231016t135315-008424-0020e8-01.military_harbor.shp', help='输入shapefile文件')
|
||||
parser.add_argument('-o', '--outfile',type=str,default=r'D:\港口\港口dota\Geo_bc2-sm-org-vv-20231016t135315-008424-0020e8-01.military_harbor.txt', help='输出geojson文件')
|
||||
parser.add_argument('-m', '--mLC',type=str,help=r'MLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\港口(民船).shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军港.shp')
|
||||
parser.add_argument('-jm', '--jmlc',type=str,help=r'JMLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军民一体港口.shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君港.shp')
|
||||
parser.add_argument('-jm', '--jmlc',type=str,help=r'JMLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君民一体港口.shp')
|
||||
parser.add_argument('-d', '--difficulty',type=int,default=1, help='输出geojson文件')
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ def SpliteProcess(srcfolderpath,infolderpath,outfolderpath):
|
|||
|
||||
labeltxtPaths=find_label_files_pathlib(infolderpath)
|
||||
|
||||
JportLabel=os.path.join(outfolderpath,'军港')
|
||||
JportLabel=os.path.join(outfolderpath,'君港')
|
||||
MportLabel=os.path.join(outfolderpath,'民港')
|
||||
MJportLabel=os.path.join(outfolderpath,'混合港')
|
||||
NoportLabel=os.path.join(outfolderpath,'无港口')
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ def statictNumber(inlabelfilepath):
|
|||
def StaticProcess(inlabelfolder,outcsvpath):
|
||||
labelfilepaths=find_txt_files_pathlib(inlabelfolder)
|
||||
with open(outcsvpath,"w",encoding="utf-8") as f:
|
||||
f.write("切片名,军用飞机,民用飞机,军民一体飞机,军用轮船,民用轮船,民用机场,军用机场,军民一体机场,军用港口,民用港口,军民一体港口,总计\n")
|
||||
f.write("切片名,君用飞机,民用飞机,君民一体飞机,君用轮船,民用轮船,民用机场,君用机场,君民一体机场,君用港口,民用港口,君民一体港口,总计\n")
|
||||
f.write("标注,military_airplane, civil_airplane,mix_airpllane,military_ship,civil_ship,civil_airport,military_airport,mix_airport,military_harbor,civil_harbor,mix_harbor,Total\n")
|
||||
|
||||
for labelfilepath in labelfilepaths:
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import argparse
|
|||
def stats_ship_labels(input_dir, output_file, person="", work_time=""):
|
||||
header = [
|
||||
"标签", "负责人", "作业时间",
|
||||
"军用飞机", "民用飞机", "军民一体飞机",
|
||||
"军用轮船", "民用轮船",
|
||||
"民用机场", "军用机场", "军民一体机场",
|
||||
"民用港口", "军用港口", "军民一体港口",
|
||||
"君用飞机", "民用飞机", "君民一体飞机",
|
||||
"君用轮船", "民用轮船",
|
||||
"民用机场", "君用机场", "君民一体机场",
|
||||
"民用港口", "君用港口", "君民一体港口",
|
||||
"总计"
|
||||
]
|
||||
alias = [
|
||||
|
|
@ -50,16 +50,16 @@ def stats_ship_labels(input_dir, output_file, person="", work_time=""):
|
|||
# "负责人":person,
|
||||
# "作业时间":work_time,
|
||||
# "民用飞机":0,
|
||||
# "军用飞机":0,
|
||||
# "军民一体飞机":0,
|
||||
# "军用轮船":0,
|
||||
# "君用飞机":0,
|
||||
# "君民一体飞机":0,
|
||||
# "君用轮船":0,
|
||||
# "民用轮船":counts["民用轮船"],
|
||||
# "民用机场":0,
|
||||
# "军用机场":0,
|
||||
# "军民一体机场":0,
|
||||
# "军用港口":0,
|
||||
# "君用机场":0,
|
||||
# "君民一体机场":0,
|
||||
# "君用港口":0,
|
||||
# "民用港口":0,
|
||||
# "军民一体港口":0
|
||||
# "君民一体港口":0
|
||||
# }
|
||||
# row["总计"] = row["民用轮船"]
|
||||
# rows.append(row)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def preProcessShipPortTools(srcFolderPath,targetFolderPath,outTargetFolderPath):
|
|||
#
|
||||
# # 文件接口创建
|
||||
# MPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","民港口")
|
||||
# JPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","军港口")
|
||||
# JPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","君港口")
|
||||
# MJPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","混合港口")
|
||||
# NoPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","无港口")
|
||||
#
|
||||
|
|
@ -105,8 +105,8 @@ def preProcessShipPortTools(srcFolderPath,targetFolderPath,outTargetFolderPath):
|
|||
existOrCreate(outMJPortFolderPath)
|
||||
|
||||
MLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\港口(民船).shp"
|
||||
JLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军港.shp"
|
||||
MJLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军民一体港口.shp"
|
||||
JLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君港.shp"
|
||||
MJLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君民一体港口.shp"
|
||||
|
||||
processMJPortflag=processMJPort(srcFolderPath,outMJPortSumTxtPath,outMJPortFolderPath,MLCShapeFilePath,JLCShapeFilePath,MJLCShapeFilePath)
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def preProcessShipPortTools(srcFolderPath,targetFolderPath,outTargetFolderPath):
|
|||
|
||||
# 文件接口创建
|
||||
MPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","民港口")
|
||||
JPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","军港口")
|
||||
JPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","君港口")
|
||||
MJPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","混合港口")
|
||||
NoPortFolder=os.path.join(targetFolderPath,"AC-图像预处理","无港口")
|
||||
|
||||
|
|
@ -105,8 +105,8 @@ def preProcessShipPortTools(srcFolderPath,targetFolderPath,outTargetFolderPath):
|
|||
existOrCreate(outMJPortFolderPath)
|
||||
|
||||
MLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\港口(民船).shp"
|
||||
JLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军港.shp" # 数据BM,不公开
|
||||
MJLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军民一体港口.shp"
|
||||
JLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君港.shp" # 数据BM,不公开
|
||||
MJLCShapeFilePath=r"D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君民一体港口.shp"
|
||||
|
||||
processMJPortflag=processMJPort(srcFolderPath,outMJPortSumTxtPath,outMJPortFolderPath,MLCShapeFilePath,JLCShapeFilePath,MJLCShapeFilePath)
|
||||
# 港口归属
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ from pathlib import Path
|
|||
import shutil
|
||||
|
||||
"""
|
||||
1. 港口,5000x5000,军港与民港切片,
|
||||
1. 港口,5000x5000,君港与民港切片,
|
||||
a. 预标注框给他们
|
||||
b. 重叠率25%重复
|
||||
c. 军民2000m 以内,影像抽出来
|
||||
c. 君民2000m 以内,影像抽出来
|
||||
d. 原影像如果只有 1 个港口,-》 港口类型
|
||||
多 个港口,-》 远近,如果港口距离1000m ,单独拉出来
|
||||
|
||||
|
|
@ -269,8 +269,8 @@ def getParams():
|
|||
parser.add_argument('-o', '--outfilepath',type=str,default=r'D:\TYSAR-德清院\TYSAR-条带模式(SM)\港口\20250903-不分类\A-预处理\JMPort.txt', help='输出geojson文件')
|
||||
parser.add_argument('-f', '--folderOutpath',type=str,help=r'PortfolderOutpath', default=r'D:\TYSAR-德清院\TYSAR-条带模式(SM)\港口\20250903-不分类\A-预处理\PortPoints')
|
||||
parser.add_argument('-m', '--mLC',type=str,help=r'MLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\港口(民船).shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军港.shp')
|
||||
parser.add_argument('-jm', '--jmlc',type=str,help=r'JMLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军民一体港口.shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君港.shp')
|
||||
parser.add_argument('-jm', '--jmlc',type=str,help=r'JMLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君民一体港口.shp')
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
|
|
|
|||
|
|
@ -247,10 +247,10 @@ def getParams():
|
|||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-s','--srcfolder',type=str,default=r'R:\TYSAR-德清院\TYSAR-条带模式(SM)\港口', help='输入shapefile文件')
|
||||
parser.add_argument('-i','--intiffolder',type=str,default=r'D:\TYSAR-德清院\切片结果整理', help='输入shapefile文件')
|
||||
parser.add_argument('-o', '--outfolder',type=str,default=r'D:\TYSAR-德清院\军民区分结果', help='输出geojson文件')
|
||||
parser.add_argument('-o', '--outfolder',type=str,default=r'D:\TYSAR-德清院\君民区分结果', help='输出geojson文件')
|
||||
parser.add_argument('-m', '--mLC',type=str,help=r'MLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\港口(民船).shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军港.shp')
|
||||
parser.add_argument('-jm', '--jmLC',type=str,help=r'MJLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\军民一体港口.shp')
|
||||
parser.add_argument('-j', '--jLC',type=str,help=r'JLC' ,default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君港.shp')
|
||||
parser.add_argument('-jm', '--jmLC',type=str,help=r'MJLC', default=r'D:\TYSAR-德清院\目标点位信息更新\0828目标点位\君民一体港口.shp')
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue