Views
No views yet
1from huggingface_hub import hf_hub_download
2import tensorflow as tf
3import json
4
5# Download model and class indices
6model_path = hf_hub_download(repo_id="Rvish-glitch/leaf-disease-detection", filename="final_model.h5")
7indices_path = hf_hub_download(repo_id="Rvish-glitch/leaf-disease-detection", filename="class_indices.json")
8
9# Load model
10model = tf.keras.models.load_model(model_path)
11
12# Load class indices
13with open(indices_path, 'r') as f:
14 class_indices = json.load(f)