😁This project utilizes the SAM algorithm for segmenting tongues in images, followed by classification using ViT.
- Place the tongue images you want to recognize in the
data/orin
folder. - 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
.
- To use the cropped tongue bounding box images, set the variable
- The current classification is based on tongue color and tongue coating status. Details can be found in the 2
class_indices.json
files.
If you need to perform fine-tuning, you can use the code provided in train.py
.
- Download the tongue segmentation model (
tonguesam.pth
) from the following link: Download here (Placetonguesam.pth
in the./pretrained_model/
folder). - Download the ViT model (
ViT.pth
) from the following link: Download here (PlaceViT.pth
in the./weight/
folder).
This project is licensed under the MIT License. See the LICENSE file for details.