use pathlib to determine f_name

pull/19/head
Konstantin Baierer 4 years ago
parent 85d631aadf
commit 2bef2d4c04

@ -9,6 +9,7 @@ import random
import sys import sys
import time import time
import warnings import warnings
from pathlib import Path
from multiprocessing import Process, Queue, cpu_count from multiprocessing import Process, Queue, cpu_count
from sys import getsizeof from sys import getsizeof
@ -148,12 +149,8 @@ class eynollah:
self.headers_off = headers_off self.headers_off = headers_off
self.dir_of_deskewed = dir_of_deskewed self.dir_of_deskewed = dir_of_deskewed
self.dir_of_all = dir_of_all self.dir_of_all = dir_of_all
if self.f_name is None: if not self.f_name:
try: self.f_name = Path(Path(image_dir).name).stem
self.f_name = image_dir.split("/")[len(image_dir.split("/")) - 1]
self.f_name = self.f_name.split(".")[0]
except:
self.f_name = self.f_name.split(".")[0]
self.dir_models = dir_models self.dir_models = dir_models
self.kernel = np.ones((5, 5), np.uint8) self.kernel = np.ones((5, 5), np.uint8)

Loading…
Cancel
Save