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.3.tar.gz (37.1 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.3-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traini_ai-2.0.3.tar.gz
  • Upload date:
  • Size: 37.1 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.3.tar.gz
Algorithm Hash digest
SHA256 ba150071a4b6c443445e2a035aa9dc8a536ecc711a6f044f2fa5ea0d660d5feb
MD5 dbcbad87004f534d2d4955cdab4f6a6d
BLAKE2b-256 dd9f00d58c8c4dbc9a6b4a06d2533f151b9434be37983268cc3d80df656cdf1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traini_ai-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 30.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fcbdabcb4735b6630175b596ffd66164ac26fce4cea5b65cb45b70ce2b9c76d8
MD5 d9bffc8760561194c5fb7e7b2e723b42
BLAKE2b-256 79667828da91cd5b336d1d155741515b8ce64a2aca0d097e1cb8db78bc37f4e7

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