Skip to main content

A lightweight and modular PyTorch-based image classification package

Project description

Christofy 🧠📦

Christofy is a lightweight and modular PyTorch-based image classification package designed for both training and prediction. Built on top of ResNet18, it supports both binary and multi-class classification with clean abstractions and an easy-to-use API. Now featuring a powerful RAG (Retrieval-Augmented Generation) system with Ollama integration!


🚀 Features

  • ✅ Train image classifiers using CNN (ResNet18)
  • ✅ Binary and multi-class classification support
  • ✅ Predict the class of a single image using saved model
  • ✅ Modular structure: clean separation between training and prediction
  • ✅ RAG pipeline with Ollama integration for text analysis
  • ✅ Support for multiple file formats (PDF, DOCX, CSV, Excel, TXT, JSON)
  • ✅ Ready to be installed as a Python package

📚 Usage

Image Classification

import christofy

# Train a model
christofy.train_model(
    data_dir="path/to/dataset",
    learning_rate=0.001,
    epochs=10,
    batch_size=32,
    output_dir="output"
)

# Make predictions
predicted_class = christofy.predict_image(
    model_path="output/model.pth",
    image_path="path/to/image.jpg"
)

RAG Pipeline

from christofy import run_rag_pipeline

# Example usage
response = run_rag_pipeline(
    data="path/to/documents",  # Can be file, directory, or text
    query="Your question here?",
    model="llama2",              # Your local Ollama model
    embedding_model="nomic-embed-text",  # For embeddings
    temperature=0.7
)

print(response)

Supported File Formats for RAG

  • PDF files (requires PyPDF2 or pdfplumber)
  • Word documents (DOCX) (requires python-docx)
  • CSV and Excel files (requires pandas)
  • Text files (TXT)
  • JSON files

Requirements

  • Python 3.9+
  • PyTorch
  • Ollama (for RAG functionality)
  • Additional dependencies based on file formats

Installation

pip install christofy

For PDF support:

pip install PyPDF2  # or pdfplumber

For DOCX support:

pip install python-docx

For CSV/Excel support:

pip install pandas openpyxl

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

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

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

christofy-0.0.3.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

christofy-0.0.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file christofy-0.0.3.tar.gz.

File metadata

  • Download URL: christofy-0.0.3.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for christofy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 83f6b0f61248d096d961e6a99b37677a1af888c7914dc277cf42d80605e5f1ae
MD5 50e9b255bd94208c296002d0bd79417d
BLAKE2b-256 b94017261a6b07840cef328e1f3ca585f822e6062aa2e3c7494636d7829c21fc

See more details on using hashes here.

File details

Details for the file christofy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: christofy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for christofy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03fffab5c35cb77fe9b30138fadb7463885f36a6321776ef994acf661d5c6546
MD5 4b909dd9c88a149bcbc39f8d4c112e6e
BLAKE2b-256 916a0d33490333b943c84fcf71ffc7a7e69e0398293a236938e485fd88013995

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