Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,56 +7,91 @@ import pandas as pd
|
|
| 7 |
|
| 8 |
# Define the breeds based on Indian bovine classification
|
| 9 |
BREEDS = [
|
| 10 |
-
|
| 11 |
-
"Kankrej", "Ongole", "Krishna Valley", "Deoni", "Hallikar",
|
| 12 |
-
"Amritmahal", "Khillari", "Kangayam", "Bargur", "Umblachery",
|
| 13 |
-
"Pulikulam", "Alambadi", "Jersey", "Holstein Friesian", "Brown Swiss",
|
| 14 |
-
"Murrah", "Surti", "Jaffrabadi", "Bhadawari", "Nili Ravi",
|
| 15 |
-
"Mehsana", "Nagpuri", "Toda", "Marathwadi", "Pandharpuri"
|
| 16 |
]
|
| 17 |
|
| 18 |
# Breed information dictionary
|
| 19 |
BREED_INFO = {
|
| 20 |
-
"
|
| 21 |
-
"type": "
|
| 22 |
-
"origin": "
|
| 23 |
-
"characteristics": "
|
| 24 |
-
"milk_yield": "
|
| 25 |
-
"special_features": "
|
| 26 |
},
|
| 27 |
-
"
|
| 28 |
-
"type": "
|
| 29 |
-
"origin": "
|
| 30 |
-
"characteristics": "
|
| 31 |
-
"milk_yield": "
|
| 32 |
-
"special_features": "
|
| 33 |
},
|
| 34 |
-
"
|
| 35 |
-
"type": "
|
| 36 |
-
"origin": "
|
| 37 |
-
"characteristics": "
|
| 38 |
-
"milk_yield": "
|
| 39 |
-
"special_features": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
},
|
| 41 |
-
"
|
| 42 |
-
"type": "
|
| 43 |
-
"origin": "
|
| 44 |
-
"characteristics": "
|
| 45 |
-
"milk_yield": "
|
| 46 |
-
"special_features": "
|
| 47 |
},
|
| 48 |
"Murrah": {
|
| 49 |
-
"type": "Indigenous Buffalo",
|
| 50 |
-
"origin": "Haryana,
|
| 51 |
-
"characteristics": "
|
| 52 |
-
"milk_yield": "
|
| 53 |
-
"special_features": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 55 |
-
# Add more breed details as needed
|
| 56 |
-
}
|
| 57 |
|
| 58 |
class IndianBovineClassifier:
|
| 59 |
-
def __init__(self, model_path=
|
| 60 |
"""Initialize the classifier with a pre-trained model"""
|
| 61 |
if model_path:
|
| 62 |
self.model = tf.keras.models.load_model(model_path)
|
|
|
|
| 7 |
|
| 8 |
# Define the breeds based on Indian bovine classification
|
| 9 |
BREEDS = [
|
| 10 |
+
'Ayrshire cattle', 'Brown Swiss cattle', 'Holstein Friesian cattle', 'Jaffrabadi', 'Jersey cattle', 'Murrah', 'Red Dane cattle', 'kankarej', 'sahiwal', 'sahiwal cross', 'sibbi'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
]
|
| 12 |
|
| 13 |
# Breed information dictionary
|
| 14 |
BREED_INFO = {
|
| 15 |
+
"Ayrshire cattle": {
|
| 16 |
+
"type": "Dairy Cow",
|
| 17 |
+
"origin": "Scotland",
|
| 18 |
+
"characteristics": "Strong, adaptable, excellent udder conformation and superior grazing ability",
|
| 19 |
+
"milk_yield": "6000-7000 liters per lactation",
|
| 20 |
+
"special_features": "Red and white patches, hardy in cold weather, high butterfat content"
|
| 21 |
},
|
| 22 |
+
"Brown Swiss cattle": {
|
| 23 |
+
"type": "Dual-purpose (Dairy & Beef)",
|
| 24 |
+
"origin": "Switzerland",
|
| 25 |
+
"characteristics": "Docile, strong, excellent for cheese production, disease resistant",
|
| 26 |
+
"milk_yield": "10000-14000 liters per lactation",
|
| 27 |
+
"special_features": "Light to dark brown color with creamy white muzzle, exceptional longevity"
|
| 28 |
},
|
| 29 |
+
"Holstein Friesian cattle": {
|
| 30 |
+
"type": "Dairy Cow",
|
| 31 |
+
"origin": "Netherlands/Germany",
|
| 32 |
+
"characteristics": "Highest milk production, excellent feed conversion, docile temperament",
|
| 33 |
+
"milk_yield": "8000-12000 liters per lactation",
|
| 34 |
+
"special_features": "Distinctive black and white patches, large frame, heat sensitive"
|
| 35 |
+
},
|
| 36 |
+
"Jaffrabadi": {
|
| 37 |
+
"type": "Indigenous Dairy Buffalo",
|
| 38 |
+
"origin": "Gujarat, India (Saurashtra region)",
|
| 39 |
+
"characteristics": "Heaviest Indian buffalo breed, adapted to harsh semi-arid conditions",
|
| 40 |
+
"milk_yield": "2000-2500 liters per lactation",
|
| 41 |
+
"special_features": "Black color, dome-shaped forehead, ring-like horns, highest butterfat content"
|
| 42 |
},
|
| 43 |
+
"Jersey cattle": {
|
| 44 |
+
"type": "Dairy Cow",
|
| 45 |
+
"origin": "Jersey, Channel Islands",
|
| 46 |
+
"characteristics": "Efficient feed conversion, calving ease, heat tolerant, docile",
|
| 47 |
+
"milk_yield": "4500-6500 liters per lactation",
|
| 48 |
+
"special_features": "Light tan to fawn color, smallest dairy breed, highest butterfat percentage"
|
| 49 |
},
|
| 50 |
"Murrah": {
|
| 51 |
+
"type": "Indigenous Dairy Buffalo",
|
| 52 |
+
"origin": "Haryana and Punjab, India",
|
| 53 |
+
"characteristics": "Highest milk yielding buffalo breed, docile nature, good mothers",
|
| 54 |
+
"milk_yield": "2200-3000 liters per lactation",
|
| 55 |
+
"special_features": "Jet black color, tightly curved horns, compact body structure"
|
| 56 |
+
},
|
| 57 |
+
"Red Dane cattle": {
|
| 58 |
+
"type": "Dual-purpose (Dairy & Beef)",
|
| 59 |
+
"origin": "Denmark",
|
| 60 |
+
"characteristics": "Hardy, disease resistant, excellent meat quality, easy calving",
|
| 61 |
+
"milk_yield": "8000-10000 liters per lactation",
|
| 62 |
+
"special_features": "Red to dark mahogany color with white markings, good heat tolerance"
|
| 63 |
+
},
|
| 64 |
+
"kankarej": {
|
| 65 |
+
"type": "Indigenous Dual-purpose (Dairy & Draught)",
|
| 66 |
+
"origin": "Gujarat, India (Kankrej territory)",
|
| 67 |
+
"characteristics": "Active, strong draught animal, drought resistant, disease resistant",
|
| 68 |
+
"milk_yield": "1500-2000 liters per lactation",
|
| 69 |
+
"special_features": "Silver to gray to steel black color, lyre-shaped horns, large pendulous ears"
|
| 70 |
+
},
|
| 71 |
+
"sahiwal": {
|
| 72 |
+
"type": "Indigenous Dairy Cow",
|
| 73 |
+
"origin": "Punjab, Pakistan/India",
|
| 74 |
+
"characteristics": "Heat resistant, tick resistant, high disease resistance, docile",
|
| 75 |
+
"milk_yield": "2500-3200 liters per lactation",
|
| 76 |
+
"special_features": "Brownish red to grayish red color, loose dewlap, compact build"
|
| 77 |
+
},
|
| 78 |
+
"sahiwal cross": {
|
| 79 |
+
"type": "Crossbred Dairy Cow",
|
| 80 |
+
"origin": "Cross breeding programs (Sahiwal x exotic breeds)",
|
| 81 |
+
"characteristics": "Hybrid vigor, improved milk yield, better adaptability than pure exotic",
|
| 82 |
+
"milk_yield": "3000-4200 liters per lactation",
|
| 83 |
+
"special_features": "Variable color depending on cross, moderate heat tolerance, enhanced productivity"
|
| 84 |
+
},
|
| 85 |
+
"sibbi": {
|
| 86 |
+
"type": "Indigenous Dual-purpose (Draught & Beef)",
|
| 87 |
+
"origin": "Sibi, Baluchistan, Pakistan",
|
| 88 |
+
"characteristics": "Largest Zebu breed, exceptional size, extremely hardy, massive build",
|
| 89 |
+
"milk_yield": "1500-2200 liters per lactation",
|
| 90 |
+
"special_features": "Pure white to grey with black neck, tallest cattle breed, exhibited at Sibi Mela"
|
| 91 |
}
|
|
|
|
|
|
|
| 92 |
|
| 93 |
class IndianBovineClassifier:
|
| 94 |
+
def __init__(self, model_path=tf_efficientnetv2_s_in21k):
|
| 95 |
"""Initialize the classifier with a pre-trained model"""
|
| 96 |
if model_path:
|
| 97 |
self.model = tf.keras.models.load_model(model_path)
|