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.
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!
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:
Here's what your terminal will look like:
Here's the output on the browser via the link given in Postman's response:
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!