mirror of
https://github.com/NanjingForestryUniversity/supermachine-tobacco.git
synced 2025-11-08 14:23:55 +00:00
perfect version2
This commit is contained in:
parent
0e297c892c
commit
fe5eececc2
@ -168,5 +168,5 @@ if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Run image test or ')
|
||||
tester = TestMain()
|
||||
tester.pony_run(test_path=r'/home/lzy/2022.7.30/tobacco_v1_0/saved_img/',
|
||||
test_rgb=False, test_spectra=False, get_delta=False)
|
||||
test_rgb=True, test_spectra=True, get_delta=False)
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ class PixelModelML:
|
||||
self.dt = pickle.load(f)
|
||||
|
||||
def predict(self, feature):
|
||||
pixel_result_array = self.dt.predict(feature)
|
||||
pixel_result_array = self.dt.predict_bin(feature)
|
||||
return pixel_result_array
|
||||
|
||||
|
||||
@ -409,7 +409,7 @@ class SpecDetector(Detector):
|
||||
if x_yellow.shape[0] == 0:
|
||||
return non_yellow_things
|
||||
else:
|
||||
tobacco = self.pixel_model_ml.predict_bin(x_yellow) < 0.5
|
||||
tobacco = self.pixel_model_ml.predict(x_yellow) < 0.5
|
||||
|
||||
non_yellow_things[yellow_things] = ~tobacco
|
||||
# 杂质mask中将背景赋值为0,将杂质赋值为1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user