Giter Club home page Giter Club logo

cartoonize-api's Introduction

DRF Cartoonize API

Logo

Description

This is a simple API made with Django's REST Framework module. As the name suggests, this API returns a link to a cartoonized image of the given input image. I have used my own gist for this task.

This API is live here at endpoint /api/cartoonize/, served on Heroku. Since Heroku does not allow for dynamically created files to be permanently stored, the file you create using this API must be downloaded as soon as possible, or at least before the dyno restarts.

Working

Original Image

Original Image

Cartoonized Image

Cartoonized Image

Parameters

All of the parameters are mandatory!

1. *name* : Give it any name you want!
2. *ext* : Set the desired extension for the output file. Like PNG or JPG!
3. *file* : Upload the input image!

Usage

The local version can be used via curl or an API testing suite such as Postman. If you want to hit the live API, swap out https://127.0.0.1:8000 for http://cartoonize-api.herokuapp.com/ and move to step 6.

1. Clone this repo: ```git clone https://github.com/tinshade/cartoonize-api.git```
2. Change into the directory: ```cd cartoonize-api```
3. Initialize a virtual environment of your choice. My runtime is Python 3.8.0 with *venv*
4. Install dependencies: ```pip install -r requirements.txt```
5. Start the server : ```python manage.py runserver```
6. Hit the server endpoint with the three parameters as shown below:

Parameters with POSTMAN

Here's what your terminal will look like: CMD output

Here's the output on the browser via the link given in Postman's response: File on browser

Known Annoyances

1. The server times out if the image is over 1Mb.
2. Only accepts JPG, however that should not be the case. Error handling still works.
3. No detailed description of the required parameters anywhere except this page.
4. Not optimized/tested for scaling!

cartoonize-api's People

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.