Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
.env
.vscode/
157 changes: 71 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,71 @@
# HackToFuture 4.0 — Template

Welcome to your official HackToFuture 4 repository.

This repository template will be used for development, tracking progress, and final submission of your project. Ensure that all work is committed here within the allowed hackathon duration.

---

### Instructions for the teams:

- Fork the Repository and name the forked repo in this convention: hacktofuture4-team_id (for eg: hacktofuture4-A01)

---

## Rules

- Work must be done ONLY in the forked repository
- Only Four Contributors are allowed.
- After 36 hours, Please make PR to the Main Repository. A Form will be sent to fill the required information.
- Do not copy code from other teams
- All commits must be from individual GitHub accounts
- Please provide meaningful commits for tracking.
- Do not share your repository with other teams
- Final submission must be pushed before the deadline
- Any violation may lead to disqualification

---

# The Final README Template

## Problem Statement / Idea

Clearly describe the problem you are solving.

- What is the problem?
- Why is it important?
- Who are the target users?

---

## Proposed Solution

Explain your approach:

- What are you building?
- How does it solve the problem?
- What makes your solution unique?

---

## Features

List the core features of your project:

- Feature 1
- Feature 2
- Feature 3

---

## Tech Stack

Mention all technologies used:

- Frontend:
- Backend:
- Database:
- APIs / Services:
- Tools / Libraries:

---

## Project Setup Instructions

Provide clear steps to run your project:

```bash
# Clone the repository
git clone <repo-link>

# Install dependencies
...

# Run the project
...
```
# The Specter Sentinals-I01

# Problem Statement
Karnataka has one of the largest livestock populations, but the "conception rate remains low (30–40%)" due to missed estrus (heat) detection. Farmers often fail to identify the critical "12–18 hour heat window", mainly because detection depends on manual observation and behavioral patterns vary due to climatic conditions (especially in Karnataka).

This leads to:
* Missed breeding opportunities
* Financial loss (₹3000–₹5000 per cycle per animal)
* Unnecessary veterinary visits
* Reduced dairy productivity

# Proposed Solution
We propose "PashuMitra", an AI-powered cattle monitoring system that combines "automatic video-based monitoring" and "manual analysis".
The system:
* Monitors cattle using video (CCTV / uploaded / YouTube simulation)
* Detects behaviors like mounting, restlessness, and movement
* Identifies cows using ear tag mapping
* Analyzes data using rule-based AI logic
* Generates real-time alerts for heat detection

Additionally, a "manual check-in system" allows veterinarians/farmers to:
* Select a cow
* Input symptoms
* Upload image/video
* Get an instant result (Heat / Monitor / Normal)

Uniqueness:
* Combines behavior detection + cow identification
* Works without real camera (video/YouTube support)
* Designed for rural usability
* Reduces manual effort and improves decision accuracy


# Features
* CCTV Monitoring (Automatic):
Continuous video-based monitoring with simulated detection, tag recognition, and automatic alert generation.
* Manual Check-In System:
Step-based workflow (Select cow → Symptoms → Media → Result) for manual analysis.
* Video & YouTube Support:
Allows video upload or YouTube link for simulation instead of real camera.

* Cow Registration:
Store cow details (ID, name, breed, age, ear tag ID) and map tags for identification.
* Behavior-Based Analysis:
Detects mounting, movement, and restlessness to classify:
* Heat (Red)
* Monitor (Yellow)
* Healthy (Green)
* Alerts & Dashboard:
Real-time alerts and status updates displayed in dashboard.

# Tech Stack
* Frontend:
React (Vite + TypeScript), Tailwind CSS
* Backend:
FastAPI (Python)
* Database:
SQLite
* AI / Logic:
Rule-based simulation (future scope: MobileNetV2, XGBoost)
* Tools / Libraries:
OpenCV (image/video processing), Zustand (state management), GitHub (version control)

# Step to run project
1.Clone the Project
* git clone https://github.com/saritanaik3022/hacktofuture4-I01
* cd hacktofuture4-I01
2.Open terminal in project folder and run
* npm install
* npm run dev)
3.open- http://localhost:5173/
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CattleWatch AI – Cattle Monitoring System</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions organize_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import os
import shutil
import random

SOURCE = "data/images/all"
TRAIN_DIR = "data/images/train"
VAL_DIR = "data/images/val"
VAL_RATIO = 0.2

classes = ["normal", "possible_heat", "health_concern"]

print("=" * 50)
print("📂 STEP 1: ORGANIZING IMAGES")
print("=" * 50)

for cls in classes:
src_dir = os.path.join(SOURCE, cls)
train_cls = os.path.join(TRAIN_DIR, cls)
val_cls = os.path.join(VAL_DIR, cls)


os.makedirs(train_cls, exist_ok=True)
os.makedirs(val_cls, exist_ok=True)

if not os.path.exists(src_dir):
print(f"⚠️ Folder not found: {src_dir}")
print(f" Create it and put {cls} images inside!")
continue


images = [f for f in os.listdir(src_dir)
if f.lower().endswith(('.jpg', '.jpeg', '.png', '.bmp', '.webp'))]

if len(images) == 0:
print(f"⚠️ No images in {src_dir}")
continue


random.shuffle(images)


val_count = max(1, int(len(images) * VAL_RATIO))
val_images = images[:val_count]
train_images = images[val_count:]


for img in train_images:
shutil.copy2(os.path.join(src_dir, img), os.path.join(train_cls, img))

for img in val_images:
shutil.copy2(os.path.join(src_dir, img), os.path.join(val_cls, img))

print(f"✅ {cls}:")
print(f" Total: {len(images)} → Train: {len(train_images)} | Val: {len(val_images)}")

print("\n🎉 Images organized into train/ and val/ folders!")
Loading