Skip to content

Utilizes the SAM algorithm for segmenting tongues in images, followed by classification using ViT

License

Notifications You must be signed in to change notification settings

zin-Fu/Tongue-Segmentation-and-classification

Repository files navigation

Tongue-Segmentation-and-classification

😁This project utilizes the SAM algorithm for segmenting tongues in images, followed by classification using ViT.

Prediction

  1. Place the tongue images you want to recognize in the data/orin folder.
  2. Run the predict.py script. You can choose one of the following folders as the inference image path:
    • To use the cropped tongue bounding box images, set the variable cropped_img_path to ./data/cropped.
    • To use the segmented tongue images, set the variable seg_img_path to ./data/seg.

Classification Json

  • The current classification is based on tongue color and tongue coating status. Details can be found in the 2 class_indices.json files.

Fine-tuning

If you need to perform fine-tuning, you can use the code provided in train.py.

Pretrained Models

  • Download the tongue segmentation model (tonguesam.pth) from the following link: Download here (Place tonguesam.pth in the ./pretrained_model/ folder).
  • Download the ViT model (ViT.pth) from the following link: Download here (Place ViT.pth in the ./weight/ folder).

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Utilizes the SAM algorithm for segmenting tongues in images, followed by classification using ViT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages