Skip to main content

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

Metadata

Release files for traini-ai 2.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traini-ai 2.0.9
File Size Uploaded
traini_ai-2.0.9.tar.gz 37.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for traini-ai 2.0.9
File Interpreter ABI Platform
traini_ai-2.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 76.7 kB

Release files / traini_ai-2.0.9.tar.gz

Download URL traini_ai-2.0.9.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
606fdbf1c78836778b54944fe8c167f0530ba8804eab1a8f6b3ba507529ae4d1
BLAKE2b-256 checksum
How to use checksums
cbc42ded801d88369522682d33eb88b5c213da6f3d1b7daef95e58b4c6f04a77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / traini_ai-2.0.9-py3-none-any.whl

Download URL traini_ai-2.0.9-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f513e5b0ac8fae73b300bb5f7733004126593ff9c74ad507244390e56ace17c
BLAKE2b-256 checksum
How to use checksums
386a8d4ac81ad003ed25f12d40d5e16cd0e64845b2360f1f9e1717015539d6db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

2.0.9 This release

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.5

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page