GithubHelp home page GithubHelp logo

indigoyoshimaru / mascot_generator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 65.19 MB

Generate image of mascot from text for Mascot Design competition

Python 64.76% HTML 11.46% JavaScript 16.68% CSS 7.10%

mascot_generator's Introduction

Mascot Generator

The Mascot Generator is a project that leverages the power of Kandinsky 2.2 to create a text-to-image mascot generator specifically designed for the Mascot Design competitors at our company. The project aims to provide a helping hand to individuals who have creative ideas but lack the necessary design skills to bring their mascots to life.

Table of Contents

  1. Overview
  2. Installation and Usage
  3. Examples
  4. Final thoughts
  5. References

1. Overview

In this project, we have utilized Kandinsky 2.2 [1] as the core model for generating desirable mascot images based on user prompts. While we have performed some finetuning on its decoder, due to resource and time constraints, we were unable to finetune its prior model to generate output specific to our custom prompts and company logos.

On the backend side, we have employed SQLite as our database management system, SQLAlchemy for ORM and query mapping, and FastAPI for building APIs. To handle a higher volume of concurrent requests, we have chosen Gunicorn as the backend server, utilizing multiple Uvicorn workers. However, it is worth noting that due to limitations in the CUDA runtime, which does not allow the fork start method, we had to implement FastAPI's sub-API and enable the spawn method with Torch multiprocessing to run the model while simultaneously handling queuing and querying processes [2].

For the frontend, we have developed a simple user interface using PicoCSS [3] and a few lines of JavaScript to communicate with the backend.

2. Installation and Usage

  1. Clone this repository:

    git clone https://github.com/indigoYoshimaru/mascot_generator.git

  2. Install the requirements:

    pip install -r requirements.txt

  3. Start the Gunicorn Server:

    gunicorn --workers 4 --preload --worker-class=uvicorn.workers.UvicornWorker backend.main:app

    Go to localhost:8000/frontend/ and your site should look like this:

    Main Page

  4. Start your model by go to localhost:8000/subapi/docs > click Try it out > click Execute

    Start model

    Please remember the model requires up to 12GB VRAM using CUDA runtime, so use it at your own risk.

  5. Have fun!

3. Examples

Here are some images of the mascot generated by our company's employees. For more images, you can view them in the Image Gallery section on web app.

4. Final thoughts

In general, the experience was both amusing and challenging. This project was undertaken by a two-man team and was completed within a span of two days. After serving for two days, we observed that there are a total of 78 users who have generated more than 200 mascots.

Since our web app does not require user login, we have managed user identity using Fingerprint JS [4] and FastAPI session [5]. However, it is important to note that these methods can sometimes be blocked by ad-blockers and may occasionally result in a mismatch between the frontend and backend sessions.

In conclusion, we acknowledge the drawbacks mentioned earlier and are eager to seize the opportunity to further enhance and address these issues. We aspire for this project to inspire more young individuals to create innovative AI applications that can solve everyday problems in a simple yet creative manner.

mascot_generator's People

Contributors

indigoyoshimaru avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.