Enlace
haz clic para mostrar
haz clic para mostrar
سلام وقت بخیر من 2 تا کد lbp رو دارم تست میکنم خطاهاشو متوجه نمیشم ، فک میکنم کد درست باشه
کد اول:
from skimage import data
image = data.brick()
خطای کد
AttributeError Traceback (most recent call last)
<ipython-input-1-9ccd731eaba9> in <module>()
19
20
---> 21 image = data.brick()
22 lbp = local_binary_pattern(image, n_points, radius, METHOD)
23
AttributeError: module 'skimage.data' has no attribute 'brick'
کد از سایت skimage گرفتم
https://scikit-image.org/docs/dev/auto_examples/features_detection/plot_local_binary_pattern.html
کد دوم
# Store the path of training images in train_images
train_images = cvutils.imlist("../data/lbp/train/")
# Dictionary containing image paths as keys and corresponding label as value
train_dic = {}
with open('../data/lbp/class_train.txt', 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter=' ')
for row in reader:
train_dic[row[0]] = int(row[1])
خطای کد:
FileNotFoundError Traceback (most recent call last)
<ipython-input-7-abb20ea58d58> in <module>()
----> 1 train_images = cvutils.imlist("../data/lbp/train/")
2 # Dictionary containing image paths as keys and corresponding label as value
3 train_dic = {}
4 with open('../data/lbp/class_train.txt', 'rb') as csvfile:
5 reader = csv.reader(csvfile, delimiter=' ')
/usr/local/lib/python3.6/dist-packages/cvutils/cvos.py in imlist(path)
6 the directory path supplied as argument to the function.
7 """
----> 8 return [os.path.join(path, f) for f in os.listdir(path)]
FileNotFoundError: [Errno 2] No such file or directory: '../data/lbp/train/'
کد از سایت زیر گرفتم
http://hanzratech.in/2015/05/30/local-binary-patterns.html
گیت هاب کد:
https://github.com/bikz05/texture-matching
یه سوال دیگم داشتم چجوری باید دیتا ست orl رو توی پایتون بخونم؟ بعد خوندن باید با lbp فیچر بگیرم بعد فیچر بدم به شبکه دیپ