调调参

This commit is contained in:
duanmu 2023-03-15 22:52:37 +08:00
parent c3e80849a0
commit 02d222f479

View File

@ -31,7 +31,7 @@ import utils
FEATURE_INDEX = [0, 1, 2] FEATURE_INDEX = [0, 1, 2]
delete_columns = 10 # 已弃用 delete_columns = 10 # 已弃用
num_bins = 10 num_bins = 7
class WoodClass(object): class WoodClass(object):
@ -293,14 +293,14 @@ class WoodClass(object):
x = np.concatenate((x, x_hsv), axis=2) x = np.concatenate((x, x_hsv), axis=2)
x = np.reshape(x, (x.shape[0] * x.shape[1], x.shape[2])) x = np.reshape(x, (x.shape[0] * x.shape[1], x.shape[2]))
x = x[np.argsort(x[:, 0])] # x = x[np.argsort(x[:, 0])]
x = x[-self.k:, :] # x = x[-self.k:, :]
# hist, bins = np.histogram(x[:, 0], bins=num_bins) hist, bins = np.histogram(x[:, 0], bins=num_bins)
# hist = hist[1:] hist = hist[1:]
# bins = bins[1:] bins = bins[1:]
# hist_number = np.argmax(hist) hist_number = np.argmax(hist)
# x = x[(x[:, 0] > bins[hist_number]) & (x[:, 0] < bins[hist_number + 1]), :] x = x[(x[:, 0] > bins[hist_number]) & (x[:, 0] < bins[hist_number + 1]), :]
if debug_mode: if debug_mode:
# self.log.log(x) # self.log.log(x)