Skip to content

关于预测时的问题 #9

@HouseWay

Description

@HouseWay

Model loaded successfully from 'sam_model/VAE.pth'
第1张图: 1.bmp
prepare to cut DM from the image...
Traceback (most recent call last):
File "D:\JetBrains\PyCharm 2021.1.3\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\JetBrains\PyCharm 2021.1.3\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "F:/Halcon/DeepLearning/Unsupervised-Defect-Detection-Project-Based-on-VAE-GAN-Architecture-master/main.py", line 205, in
score, diff_bin = defection_detection(os.path.join(input_dir, filename), VAE_model=VAE_model,
File "F:/Halcon/DeepLearning/Unsupervised-Defect-Detection-Project-Based-on-VAE-GAN-Architecture-master/main.py", line 84, in defection_detection
mask_image, coordinates, mask, info = cut_target_from_image(image, reason_mode=reason_mode)
File "F:\Halcon\DeepLearning\Unsupervised-Defect-Detection-Project-Based-on-VAE-GAN-Architecture-master\CutTarget.py", line 217, in cut_target_from_image
masked_image_cut, cropped_mask = apply_mask(cropped_image, cropped_mask)
File "F:\Halcon\DeepLearning\Unsupervised-Defect-Detection-Project-Based-on-VAE-GAN-Architecture-master\CutTarget.py", line 113, in apply_mask
alpha[mask] = 255 # 兴趣地方标记为1,且为白色
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

出现了这个报错

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions