Skip to content

woaiwang/style-transfer-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Style Transfer Project (基于 VGG19 的风格迁移)

This project implements a style transfer application that allows users to upload an image and apply a specific artistic style to it (e.g., Van Gogh's Starry Night), using a pre-trained VGG19 model.

本项目实现了一个基于 VGG19 模型的风格迁移应用,用户可以上传图片并将其转换为特定艺术风格(如梵高星空)。

Features

  • Upload an image to the server.
  • Apply a selected artistic style to the uploaded image.
  • View the stylized image in the browser.
  • Supports multiple styles through reference images.

Project Structure

style-transfer-project
├── backend
│   ├── app.py                # Entry point for the backend application
│   ├── config.py             # Configuration parameters for the application
│   ├── requirements.txt       # Python dependencies
│   ├── core
│   │   ├── __init__.py
│   │   ├── style_transfer.py   # Core logic for style transfer
│   │   ├── vgg19.py           # VGG19 model definition and forward pass
│   │   └── layers.py          # Custom layers for content and style loss
│   ├── utils
│   │   ├── __init__.py
│   │   └── image_processing.py # Image processing utility functions
│   ├── models
│   │   └── imagenet-vgg-verydeep-19.mat # Pre-trained VGG19 model weights
│   └── static
│       ├── input             # Directory for uploaded images
│       └── output            # Directory for generated images
├── frontend
│   ├── public
│   │   ├── index.html        # Main HTML file for the frontend application
│   │   └── favicon.ico       # Application icon
│   ├── src
│   │   ├── assets
│   │   │   └── style-reference.jpg # Reference style image
│   │   ├── components
│   │   │   ├── ImageUploader.vue # Component for image upload
│   │   │   └── ResultViewer.vue  # Component for displaying results
│   │   ├── App.vue           # Main component for the frontend application
│   │   ├── main.js           # Entry point for the frontend application
│   │   └── api.js            # API interaction methods
│   ├── package.json          # Frontend project configuration
│   └── vite.config.js        # Vite configuration for building the frontend
├── docker-compose.yml         # Docker configuration for multi-container application
└── README.md                  # Project documentation

🚀 Quick Start (快速开始)

1. Clone the repository (克隆项目)

git clone https://github.com/woaiwang/style-transfer-project.git
cd style-transfer-project

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd style-transfer-project
    
  2. Set up the backend:

    • Navigate to the backend directory.
    • Install the required Python packages:
      pip install -r requirements.txt
      
  3. Set up the frontend:

    • Navigate to the frontend directory.
    • Install the required Node.js packages:
      npm install
      

Usage

  1. Start the backend server:

    cd backend
    python app.py
    
  2. Start the frontend development server:

    cd frontend
    npm run dev
    
  3. Open your browser and go to http://localhost:3000 to access the application.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors