Skip to content

Commit

Permalink
Implemented core modules, CI/CD and basic test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Klus3kk committed Dec 1, 2024
1 parent 4267200 commit 50c42b0
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 104 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Python CI

on:
push:
branches:
- main
pull_request:
branches:
- main


jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pytest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
artify.egg-info
src/__pycache__
test
test
.pytest_cache
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
# Artify
**Artify** is an AI-powered image style transfer bot that transforms ordinary photos into unique artworks inspired by famous artists. This project aims to provide a seamless, user-friendly experience for converting images into stylized renditions with a choice of well-known art styles.

## Project Features:
1. **Core Functionality**:
- **Famous Art Styles**: Apply styles from famous artists (e.g., Van Gogh, Picasso).
- **Image Upload and Download**: Users can easily upload images and download the stylized results.
- **Style Selection**: Choose from a variety of art styles for each transformation.
- **High-Quality Output**: Produces high-resolution, stylized images.

2. **Additional Capabilities** (Future Phases):
- **Custom Style Upload**: Allows users to upload and apply their own custom styles.
- **Style Recommendations**: Suggest styles based on the characteristics of the uploaded image.

## Technical Structure:
- **Backend**: Built using FastAPI or Flask to handle image processing and style application.
- **Frontend**: A simple, intuitive interface (HTML/CSS or React) for image uploads, style selection, and result previews.
- **Deployment**: Includes Docker setup and GitHub Actions for continuous integration and deployment.
- **Comprehensive Documentation**: User guidelines, sample images, and troubleshooting support.

3. **Future Enhancements**:
- Expanding the style library and custom user options.
- Real-time processing for faster, optimized results.
- A mobile-friendly interface or dedicated app for broader accessibility.

Artify is a modular AI-powered project to apply artistic styles to images.
14 changes: 14 additions & 0 deletions core/ImageProcessor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from PIL import Image

class ImageProcessor:
@staticmethod
def preprocess_image(image_path, size=512):
image = Image.open(image_path).convert("RGB")
image = image.resize((size, size))
return image

@staticmethod
def save_image(image, output_path):
image.save(output_path)


13 changes: 13 additions & 0 deletions core/StyleTransferModel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import torch
import torchvision.transforms as transforms
from PIL import Image

class StyleTransferModel:
def __init__(self, model_path):
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
self.model = torch.load(model_path).to(self.device)

def apply_style(self, content_image, style_image):
'''Style transfer logic'''
...

Binary file removed models/test.pth
Binary file not shown.
3 changes: 0 additions & 3 deletions pyproject.toml

This file was deleted.

12 changes: 7 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fastapi
uvicorn
torch
pillow
python-multipart
torch
torchvision
numpy
pillow
matplotlib
streamlit
pytest
7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

38 changes: 0 additions & 38 deletions src/main.py

This file was deleted.

26 changes: 0 additions & 26 deletions src/model.py

This file was deleted.

Binary file not shown.
2 changes: 2 additions & 0 deletions tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_example():
assert 2 + 2 == 4

0 comments on commit 50c42b0

Please sign in to comment.