本文整理匯總了Python中FileManager.FileManager.listNoHiddenFiles方法的典型用法代碼示例。如果您正苦於以下問題:Python FileManager.listNoHiddenFiles方法的具體用法?Python FileManager.listNoHiddenFiles怎麽用?Python FileManager.listNoHiddenFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileManager.FileManager
的用法示例。
在下文中一共展示了FileManager.listNoHiddenFiles方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: creaFileFeatures
# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import listNoHiddenFiles [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
示例2: creaCsv
# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import listNoHiddenFiles [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."
示例3: immagini
# 需要導入模塊: from FileManager import FileManager [as 別名]
# 或者: from FileManager.FileManager import listNoHiddenFiles [as 別名]
estension = ".jpg"
verbose=False
file_positive = root+keywords+"/"+keywords+"_" + detector + "_" + extractor + "_positive.csv"
file_negative = root+keywords+"/"+keywords+"_" + detector + "_" + extractor + "_negative.csv"
print "Preprocessing Analisi Cartelle e Files"
# List dir contiene tutte le cartelle della root img
listDir = fm.listNoHiddenDir(root)
# Cerco l'indice della cartella della Keywords
indexKeywords = listDir.index(keywords)
# Vado ad eliminare nella lista cartelle quella della keywords
listDir.pop(indexKeywords)
# Creo una lista contenente tutte le immagini (jpg) positive (Filtro estension)
listArrayPositive = fm.listNoHiddenFiles(root+keywords,estension)
# Creo una lista contenente tutte le immagini negative (Filtro estension)
listArrayNegative = []
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):