A comprehensive tool for creating labeled datasets of goat behavior and detection in agricultural environments. Built by Capra AI for advancing computer vision in livestock management.
Capra10k aims to create a large-scale, high-quality dataset for:
- Goat Detection: Individual animal identification and tracking
- Behavior Analysis: Understanding goat interactions with environment
- Agricultural AI: Supporting smart farming and livestock management
- Research: Enabling academic and commercial research in animal AI
- Interactive Polygon Labeling: Precise annotation tool for complex shapes
- Multi-Category Support: Goats, troughs, platforms, and enrichment items
- Batch Processing: Navigate through large image datasets efficiently
- Keyboard Shortcuts: Speed up annotation workflow
- Quality Control: Built-in review system for label validation
- Export Capabilities: Generate masks and overlays for training
- Node.js 14+
- Modern web browser
- Images to label (or use our sample dataset)
git clone https://github.com/yourusername/capra10k.git
cd capra10k
npm install
npm startOpen http://localhost:3000 and start labeling!
See CONTRIBUTING.md for detailed instructions on:
- Getting image datasets
- Labeling guidelines
- Contributing your work
- Handling large files
- A Vercel account (free tier works great!)
- Vercel Blob Storage connected to your project
-
Install Vercel CLI (optional, for local testing):
npm install -g vercel
-
Connect to Vercel:
- Go to vercel.com and sign in with GitHub
- Import your repository (
antonemking/capra10k) - Configure the project with these settings:
- Framework Preset:
Other - Root Directory:
./(or leave blank) - Build Command: Leave empty
- Install Command:
npm install - Output Directory: Leave empty
- Framework Preset:
-
Set up Vercel Blob Storage:
- In your Vercel project dashboard, go to Storage
- Add Blob Storage
- Copy the
BLOB_READ_WRITE_TOKENenvironment variable (this is automatically added to your project)
-
Upload Images to Blob Storage:
- Images should be stored with the prefix
goat_images/ - You can upload images via:
- Vercel Dashboard UI
- Vercel CLI:
vercel blob upload <file> --token <your-token> - Custom upload script using the
@vercel/blobSDK
- Images should be stored with the prefix
-
Deploy:
vercel deploy --prod
The following environment variable is required and automatically configured when you add Blob Storage:
BLOB_READ_WRITE_TOKEN- Vercel Blob Storage access token
// Upload script example (Node.js)
const { put } = require('@vercel/blob');
async function uploadImage(filePath) {
const fileBuffer = require('fs').readFileSync(filePath);
const blob = await put(`goat_images/${path.basename(filePath)}`, fileBuffer, {
access: 'public',
token: process.env.BLOB_READ_WRITE_TOKEN,
});
console.log('Uploaded:', blob.url);
}- Blob Storage Structure:
goat_images/- Source images to labelgoat_images_need_review/- Completed annotationsgoat_images_reviewed/- Final approved labels
- All images are stored in Vercel Blob Storage with public URLs
- The frontend automatically loads images from blob URLs
- Annotations are saved directly to blob storage
| Category | Description | Color |
|---|---|---|
| ๐ Goat | Individual goat bodies | Red |
| ๐ฝ๏ธ Trough | Feeding and water areas | Green |
| ๐ช Platform | Elevated structures, ramps | Brown |
| ๐พ Enrichment | Toys, play objects | Purple |
- Click: Place annotation points
- Click near start: Close polygon
- Drag points: Adjust polygon shape
- Right-click point: Delete point
- Scroll: Zoom in/out
โ/โ: Navigate between images1-4: Quick category selectionCtrl+S: Save & move to nextSpace: Skip current imageEsc: Reset annotationsZ/Y: Undo/Redo points
capra10k/
โโโ index.html # Main labeling interface
โโโ server.js # Express server
โโโ package.json # Dependencies
โโโ organize-images.js # Utility for managing image structures
โโโ sample_images/ # Small test images
โโโ CONTRIBUTING.md # Contributor guide
โโโ README.md # This file
# Created during use (excluded from Git):
โโโ goat_images/ # Source images to label
โ โโโ 2025/05/25/ # Optional: date-organized structure
โโโ goat_images_need_review/ # Completed work for review
โโโ goat_images_reviewed/ # Final approved dataset
The tool supports both flat and date-organized directory structures:
# For date-organized images, flatten for labeling
node organize-images.js flatten
npm start
# Restore original structure when done
node organize-images.js restoreWe welcome contributions! The project handles large image files through:
- Git exclusion: Images are not stored in the repository
- S3 distribution: Large datasets available via cloud storage
- Flexible workflow: Multiple contribution methods for different scales
See CONTRIBUTING.md for complete details.
- ๐ฏ Target: 10,000+ labeled images
- ๐ Current: [Auto-updated]
- ๐ฅ Contributors: [Community count]
- ๐ท๏ธ Categories: 4 annotation types
- Frontend: Vanilla JavaScript + Konva.js for canvas manipulation
- Backend: Node.js + Express for file handling
- Storage: Vercel Blob Storage for cloud deployment, Local filesystem for development
GET /api/images- List available images (returns array of{filename, url})POST /api/save-overlay- Save annotated overlay to blob storagePOST /api/move-to-reviewed- Move image to review queue in blob storage
[Your chosen license here]
- Contributors to the dataset
- Agricultural research community
- Open source computer vision tools
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
Built with โค๏ธ by Capra AI for the future of agricultural technology