當前位置: 首頁>>代碼示例>>Python>>正文


Python FileManager.correggi方法代碼示例

本文整理匯總了Python中FileManager.FileManager.correggi方法的典型用法代碼示例。如果您正苦於以下問題:Python FileManager.correggi方法的具體用法?Python FileManager.correggi怎麽用?Python FileManager.correggi使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FileManager.FileManager的用法示例。


在下文中一共展示了FileManager.correggi方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: creaFileFeatures

# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import correggi [as 別名]
	def creaFileFeatures(self,key=None):

		if key == None:
			## PREPROCESSING PERCORSI IMMAGINI
			fm = FileManager()
			file_positive = self.root+self.keywords+"/"+self.keywords+"_" + self.detector + "_" + self.extractor + ".csv"

			# Creo una lista contenente tutte le immagini (jpg) positive (Filtro estension)
			listArrayPositive = fm.listNoHiddenFiles(self.root+self.keywords,self.estension)

			## SAVE FEATURES IN FILES
			# Controllo se e' gia' presente, altrimenti leggo il file e restituisco array
			if not os.path.isfile(file_positive):
				print "Nuovo File Features Positive " + self.detector + " + " + self.extractor + " creato."
				X_positive = []
				for k in range(0,len(listArrayPositive)): # Da eliminare file csv ed altri
					base_name = self.root+self.keywords+"/"+self.keywords+fm.correggi(k)+ self.estension
					print "Immagini " + str(k) + " -> " + base_name 
					ret = (self.obj.elabora(base_name)) #[0:cut_features]
					X_positive.append(ret)

				fm.arrayToCsv(X_positive,file_positive)
			else:
				print "File Features Positive " + self.detector + " + " + self.extractor + " esiste gia."
				X_positive = fm.csvToArray(file_positive)
		else:
			## PREPROCESSING PERCORSI IMMAGINI
			fm = FileManager()
			file_positive = self.root+key+"/"+key+"_" + self.detector + "_" + self.extractor + ".csv"

			# Creo una lista contenente tutte le immagini (jpg) positive (Filtro estension)
			listArrayPositive = fm.listNoHiddenFiles(self.root+key,self.estension)

			## SAVE FEATURES IN FILES
			# Controllo se e' gia' presente, altrimenti leggo il file e restituisco array
			if not os.path.isfile(file_positive):
				print "Nuovo File Features Positive " + self.detector + " + " + self.extractor + " creato."
				X_positive = []
				for k in range(0,len(listArrayPositive)): # Da eliminare file csv ed altri
					base_name = self.root+key+"/"+key+fm.correggi(k)+ self.estension
					print "Immagini " + str(k) + " -> " + base_name 
					ret = (self.obj.elabora(base_name)) #[0:cut_features]
					X_positive.append(ret)

				fm.arrayToCsv(X_positive,file_positive)
			else:
				print "File Features Positive " + self.detector + " + " + self.extractor + " esiste gia."
				X_positive = fm.csvToArray(file_positive)

		return X_positive
開發者ID:massi92,項目名稱:DIP-Project_MGFF,代碼行數:52,代碼來源:FeaturesFile.py

示例2: creaCsv

# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import correggi [as 別名]
	def creaCsv(self):
		fm = FileManager()
		listCategories = fm.listNoHiddenDir(self.root)
		for cat in listCategories:
			file_positive = self.root+cat+"/"+cat+"_" + self.detector + "_" + self.extractor + ".csv"
			if not os.path.isfile(file_positive):
				#se il file non esiste viene creato
				print "Nuovo File Features Positive " + self.detector + " + " + self.extractor + " creato."
				X_positive = []
				#elaborazione immagini
				listArrayPositive = fm.listNoHiddenFiles(self.root+cat,self.estension)
				for k in range(0,len(listArrayPositive)): # Da eliminare file csv ed altri
					base_name = self.root+cat+"/"+cat+fm.correggi(k)+ self.estension
					print "Immagini " + str(k) + " -> " + base_name 
					ret = (self.obj.elabora(base_name)) #[0:cut_features]
					X_positive.append(ret)
				fm.arrayToCsv(X_positive,file_positive)	
			else:
				print "File Features Positive " + self.detector + " + " + self.extractor + " esiste gia."			
開發者ID:massi92,項目名稱:DIP-Project_MGFF,代碼行數:21,代碼來源:FeaturesFile.py

示例3: range

# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import correggi [as 別名]
for i in range(0,len(listDir)):
	item = fm.listNoHiddenFiles(root+listDir[i],estension)
	listArrayNegative.append(item)

#print listDir
#print listArrayNegative

#raw_input()

## SAVE FEATURES IN FILES
# Controllo se e' gia' presente
if not os.path.isfile(file_positive):
	print "Nuovo File Features Positive " + detector + " + " + extractor + " creato."
	X_positive = []
	for k in range(0,len(listArrayPositive)): # Da eliminare file csv ed altri
		base_name = root+keywords+"/"+keywords+fm.correggi(k)+ estension
		print "Immagini " + str(k) + " -> " + base_name 
		ret = (obj.elabora(base_name)) #[0:cut_features]
		X_positive.append(ret)

	fm.arrayToCsv(X_positive,file_positive)
else:
	print "File Features Positive " + detector + " + " + extractor + " esiste gia."

if not os.path.isfile(file_negative):
	print "Nuovo File Features Negative " + detector + " + " + extractor + " creato."
	X_negative = []
	for i in range(0,len(listDir)):
		print "#################################"
		print "Elaborazione " + listDir[i]
		for k in range(0,len(listArrayNegative[i])):
開發者ID:massi92,項目名稱:DIP-Project_MGFF,代碼行數:33,代碼來源:provaFeatures.py


注:本文中的FileManager.FileManager.correggi方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。