Skip to main content

Traini AI SDK - Dog emotion analysis and human-dog communication platform

Project description

Traini AI - Dog Emotion Analysis SDK

Python Version License Status

Advanced AI-powered dog emotion detection and image analysis SDK combining deep learning emotion recognition with multi-model visual intelligence.

🌟 Features

  • 🎯 High Accuracy: 76-88% emotion detection accuracy using 4-model ensemble
  • 🤖 Multi-Model Analysis: Integrates GPT-4, Gemini 2.5, and Claude 3 for comprehensive visual understanding
  • 📝 Dual Output: Professional third-person descriptions + playful first-person narratives
  • ⚡ Fast & Reliable: Optimized inference pipeline with automatic image format detection
  • 🔧 Easy to Use: Simple API with just 3 lines of code

📦 Installation

pip install traini-ai

🚀 Quick Start

from traini_ai import IntegratedImageAnalysisWithEmotion

# Initialize analyzer
analyzer = IntegratedImageAnalysisWithEmotion()

# Analyze dog image
result = analyzer.analyze_image('path/to/dog_image.jpg')

# Get results
print(result['third_person_description'])  # Professional analysis
print(result['first_person_description'])  # Fun dog perspective

📖 API Reference

IntegratedImageAnalysisWithEmotion

Main class for dog image analysis.

Parameters

  • openai_api_key (str, optional): OpenAI API key. Uses default if not provided.
  • google_api_key (str, optional): Google API key. Uses default if not provided.
  • anthropic_api_key (str, optional): Anthropic API key. Uses default if not provided.
  • use_ensemble (bool, default=True): Whether to use 4-model ensemble for emotion detection.

Methods

analyze_image(image_path: str) -> dict

Analyzes a dog image and returns emotional and behavioral insights.

Parameters:

  • image_path (str): Path to the dog image file. Supports JPEG, PNG, GIF, WebP.

Returns:

{
    'third_person_description': str,  # Objective third-person analysis
    'first_person_description': str   # Playful first-person narrative
}

💡 Usage Examples

Basic Usage

from traini_ai import IntegratedImageAnalysisWithEmotion

analyzer = IntegratedImageAnalysisWithEmotion()
result = analyzer.analyze_image('happy_dog.jpg')

print("Third-Person Analysis:")
print(result['third_person_description'])
print("\nFirst-Person Narrative:")
print(result['first_person_description'])

Custom API Keys

analyzer = IntegratedImageAnalysisWithEmotion(
    openai_api_key='your-openai-key',
    google_api_key='your-google-key',
    anthropic_api_key='your-anthropic-key'
)

Single Model Mode (Faster)

# Use single model for faster inference
analyzer = IntegratedImageAnalysisWithEmotion(use_ensemble=False)
result = analyzer.analyze_image('dog.jpg')

📊 Performance

Mode Accuracy Speed Memory Use Case
Ensemble (4 models) 76-88% ~3-5s ~1.2GB High accuracy needs
Single Model 74-76% ~1-2s ~300MB Real-time applications

🎨 Output Examples

Third-Person Description (Professional)

The image features a fluffy golden Pomeranian dog situated indoors on a
textured gray rug within a cozy living room setting. The dog's voluminous
fur and distinctively perked ears emphasize its breed traits, while its
dark, expressive eyes convey a sense of curiosity and attentiveness. The
dog is facing the camera with its head held high, displaying a slightly
open mouth that suggests a playful or relaxed demeanor...

First-Person Description (Playful)

Omg, hi there! 😍 I'm just chillin' here on my favorite rug, feelin' all
cozy and stuff! My floofy fur is like, 10/10 fluffy for snuggles. 🐾 My
ears are perked 'cause I'm super curious about what you're up to! Maybe
you wanna throw me a toy or give me some treats? I promise I won't get
mad – just playful wags and happy barks! 🐶💖

🔬 Technology Stack

Emotion Detection

  • AttentionResNet50: Advanced attention mechanism
  • ResNet50: Robust feature extraction
  • ResNet101: Deep architecture for complex patterns
  • EfficientNet: Optimized efficiency and accuracy

Visual Analysis

  • GPT-4o-mini: General visual understanding
  • Gemini 2.5 Flash Lite: Fast image processing
  • Claude 3 Haiku: Detailed emotion interpretation

🎯 Supported Emotions

The SDK can detect 13 different dog emotions:

  • Happy
  • Sad
  • Angry
  • Alert
  • Relaxed
  • Fear
  • Anxiety
  • Anticipation
  • Appeasement
  • Caution
  • Confident
  • Curiosity
  • Sleepy

🖼️ Supported Image Formats

  • JPEG/JPG
  • PNG
  • GIF
  • WebP

⚙️ Requirements

  • Python 3.8+
  • PyTorch 1.9+
  • OpenAI SDK
  • Google Generative AI
  • Anthropic SDK

📄 License

MIT License - see LICENSE file for details

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

🔄 Changelog

v2.0.0 (2024-12-14)

  • ✨ Added multi-model integration (GPT, Gemini, Claude)
  • ✨ Implemented 4-model ensemble emotion detection
  • ✨ Dual output: third-person + first-person descriptions
  • 🔧 Automatic image format detection
  • 📝 Simplified API with clean output
  • 🚀 Production-ready with error handling

v1.0.0 (2024-12-01)

  • 🎉 Initial release
  • 🤖 Single model emotion detection
  • 📊 Basic image analysis

🙏 Acknowledgments

Built with advanced AI models from OpenAI, Google, and Anthropic.


Made with ❤️ by the Traini AI Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traini_ai-2.0.7.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traini_ai-2.0.7-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file traini_ai-2.0.7.tar.gz.

File metadata

  • Download URL: traini_ai-2.0.7.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for traini_ai-2.0.7.tar.gz
Algorithm Hash digest
SHA256 e077b97c4ad855d1301de7cdd30a20383bf062eb97f403eaea7f86e28f1a0898
MD5 d8ddcaf91c416cfe3b63c3fb6f694d50
BLAKE2b-256 1db5552685d96a3ecb068ecc3043e48eeb96b9a73850f1a100fb64f41409caa7

See more details on using hashes here.

File details

Details for the file traini_ai-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: traini_ai-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for traini_ai-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a43434656512b383d10607140ca8e1cef4a561a947e37bd14c0ce036dc8be246
MD5 debefa15ab41f098c3d6d8ad7543ddea
BLAKE2b-256 a3d76b4f507d17722e2b28a3ab0e4d326a96940f8def4413879b69472dcb9b80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page