Skip to content

# NeurBrush: Style Transfer API with Django NeurBrush is a Django REST API for artistic style transfer using CNNs (VGG19, VGG16) and GANs. Upload an image, apply deep style transformations, and get the styled output via URL.

Notifications You must be signed in to change notification settings

kelvinprabhu/NeuroBrushStyleTansfer_Django_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Style Transfer API with Django using REST framework

This Django backend provides a REST API for image style transfer, allowing users to upload content and style images. The core functionality includes handling image processing requests, utilizing deep learning models, and returning transformed images as URLs.

Key Features

  1. Image Upload Handling:

    • Uses Django’s MultiPartParser and FormParser to handle file uploads.
    • Validates input to ensure both content and style images are provided.
  2. Style Transfer Logic:

    • Deep Learning Model Integration: Utilizes PyTorch for deep learning operations, particularly leveraging a pre-trained VGG19 model.
    • Feature Extraction and Style Transfer:
      • Images are pre-processed using torchvision transforms (resize, normalization, etc.) to make them compatible with the deep learning model.
      • The content image and style image are processed separately.
      • Features from the content image are blended with style features from the style image using style transfer techniques such as neural style transfer (NST).
      • The transformed image is generated by inverting the blended features back to the image space.
  3. Result Handling:

    • The resulting image from the style transfer is saved to the server's media directory using PIL for image processing and os for path handling.
    • The path to the saved image is returned as a URL, making it easily accessible for the frontend application.
  4. Real-Life Application:

    • This API can be used in various industries such as e-commerce for personalized product recommendations, advertising for creating unique visual content, and art for digital artwork transformation.
    • Example Use Case: E-commerce platforms could use this API to offer personalized style suggestions to customers based on the product they are viewing, allowing them to see how it would look in various styles before making a purchase.
  5. Deployment:

    • Deploy the Django backend on a server with public access, ensuring proper security practices like HTTPS, authentication, and rate limiting.
    • The API interacts with the front-end through endpoints that handle image upload requests and provide results.

About

# NeurBrush: Style Transfer API with Django NeurBrush is a Django REST API for artistic style transfer using CNNs (VGG19, VGG16) and GANs. Upload an image, apply deep style transformations, and get the styled output via URL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages