[fix] 修复一个可能导致问题的地方

This commit is contained in:
li.zhenye 2022-08-05 09:19:51 +08:00
parent 6831ffddff
commit 4d6fd3cd3a

View File

@ -11,8 +11,8 @@ def main(only_spec=False, only_color=False):
spec_detector = SpecDetector(blk_model_path=Config.blk_model_path, pixel_model_path=Config.pixel_model_path) spec_detector = SpecDetector(blk_model_path=Config.blk_model_path, pixel_model_path=Config.pixel_model_path)
rgb_detector = RgbDetector(tobacco_model_path=Config.rgb_tobacco_model_path, rgb_detector = RgbDetector(tobacco_model_path=Config.rgb_tobacco_model_path,
background_model_path=Config.rgb_background_model_path) background_model_path=Config.rgb_background_model_path)
_, _ = spec_detector.predict(np.ones(Config.nRows, Config.nCols, Config.nBands)*0.4),\ _, _ = spec_detector.predict(np.ones(Config.nRows, Config.nCols, Config.nBands, dtype=float)*0.4),\
rgb_detector.predict(np.ones(Config.nRgbRows, Config.nRgbCols, Config.nRgbBands)*0.4) rgb_detector.predict(np.ones((Config.nRgbRows, Config.nRgbCols, Config.nRgbBands), dtype=np.uint8)*40)
total_len = Config.nRows * Config.nCols * Config.nBands * 4 # float型变量, 4个字节 total_len = Config.nRows * Config.nCols * Config.nBands * 4 # float型变量, 4个字节
total_rgb = Config.nRgbRows * Config.nRgbCols * Config.nRgbBands * 1 # int型变量 total_rgb = Config.nRgbRows * Config.nRgbCols * Config.nRgbBands * 1 # int型变量
if not os.access(img_fifo_path, os.F_OK): if not os.access(img_fifo_path, os.F_OK):