Skip to main content

SimpleAI_Image

A package for processing and storing image vectors in PostgreSQL.

Installation

pip install SimpleAI_Image

from SimpleAI_Image import DatabaseHandler, DataProcessor
from sklearn.datasets import fetch_openml
from tensorflow.keras.applications.vgg16 import preprocess_input as vgg_preprocess_input

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sqlalchemy import text

# Define the database URL and table name
db_url = 'postgresql+psycopg2://Username:Password@localhost:5432/ThisISATEST'
db_handler = DatabaseHandler(db_url, 'vector_data', 512)

# Instantiate DataProcessor with VGG16 model
data_processor = DataProcessor(db_handler, model_name='VGG16', preprocess_func=vgg_preprocess_input, image_size=(32, 32))

# Load the example dataset (MNIST)
mnist = fetch_openml('mnist_784', version=1)
X = mnist.data[:500]  # Limit to 500 instances for testing
y = mnist.target[:500].astype(int)  # Ensure targets are integers

# Process data and store in database
X_embedded, y = data_processor.process_data(X, y)

# Fetch and preprocess data for visualization
query = text("SELECT * FROM vector_data")
X_embedded, y = data_processor.fetch_and_preprocess_data(query)

# Visualize data
data_processor.visualize_data(X_embedded, y)

Metadata

Release files for SimpleAI-Image 0.1.8

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

Source distribution (sdist)

Source distribution for SimpleAI-Image 0.1.8
File Size Uploaded
simpleai_image-0.1.8.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SimpleAI-Image 0.1.8
File Interpreter ABI Platform
SimpleAI_Image-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / simpleai_image-0.1.8.tar.gz

Download URL simpleai_image-0.1.8.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3a9cae6592ad5ce9c12d1cc4d8534caaa8761f786dd5ffcf9d857b4ae27bb4ef
BLAKE2b-256 checksum
How to use checksums
bda0cd9277a2c722ba25c10e9ef06f3860751309ee66c35b34f16f641f798783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.10

Release files / SimpleAI_Image-0.1.8-py3-none-any.whl

Download URL SimpleAI_Image-0.1.8-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea995dd08eb027da134792f52c29b191a9de1f1e6f66b4510987f07c8d1acbc2
BLAKE2b-256 checksum
How to use checksums
7f6979297f53db5d0118dfd81a36b976290b950b44d09dc2f9c23718f71ed8ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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