Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pred_mask_path is not correct. #10

Open
jyp-studio opened this issue Mar 25, 2024 · 0 comments
Open

pred_mask_path is not correct. #10

jyp-studio opened this issue Mar 25, 2024 · 0 comments

Comments

@jyp-studio
Copy link

While I faced the problem when using the command metioned in your demo step.

python FoodSAM/semantic.py --img_path <path/to/img> --output <path/to/output>

However, I got this error message:

Traceback (most recent call last):
  File "FoodSAM/semantic.py", line 322, in <module>
    main(args)
  File "FoodSAM/semantic.py", line 309, in main
    enhance_masks(args.output, args.category_txt, args.color_list_path, num_class=args.num_class, area_thr=args.area_thr, ratio_thr=args.ratio_thr, top_k=args.top_k)
  File "/DATA/jyp/FoodSAM/FoodSAM/FoodSAM_tools/enhance_semantic_masks.py", line 100, in enhance_masks
    pred_mask = cv2.imread(pred_mask_path)[:,:,2]
TypeError: 'NoneType' object is not subscriptable

It seems that the code cannot find the correct path to the corresponding mask generated by the model.
Please tell me how to solve this problem.

Additionally, can the output of a food image to be a corresponding mask but not a file within plenty of files such as input.jpg, mask folders, and metadata.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant