{"id":13394797,"url":"https://github.com/danmacnish/cartoonify","last_synced_at":"2025-05-15T17:09:09.128Z","repository":{"id":33451715,"uuid":"114759717","full_name":"danmacnish/cartoonify","owner":"danmacnish","description":"python app to turn a photograph into a cartoon","archived":false,"fork":false,"pushed_at":"2022-12-07T23:51:56.000Z","size":114421,"stargazers_count":2052,"open_issues_count":28,"forks_count":204,"subscribers_count":62,"default_branch":"master","last_synced_at":"2025-04-08T08:11:15.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danmacnish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-19T11:55:48.000Z","updated_at":"2025-04-05T18:04:47.000Z","dependencies_parsed_at":"2023-01-15T01:01:12.489Z","dependency_job_id":null,"html_url":"https://github.com/danmacnish/cartoonify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnish%2Fcartoonify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnish%2Fcartoonify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnish%2Fcartoonify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnish%2Fcartoonify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danmacnish","download_url":"https://codeload.github.com/danmacnish/cartoonify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384989,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:31.882Z","updated_at":"2025-05-15T17:09:04.120Z","avatar_url":"https://github.com/danmacnish.png","language":"Python","readme":"## Draw This.\n\n[_Draw This_](http://danmacnish.com/2018/07/01/draw-this/) is a polaroid camera that draws cartoons.\nYou point, and shoot - and out pops a cartoon; the camera's best interpretation of what it saw.\nThe camera is a mash up of a neural network for object recognition, the google quickdraw dataset, a thermal printer, and a raspberry pi.\n\nIf you'd like to try it out for yourself, [the good folks at Kapwing have created an online version!](https://www.kapwing.com/cartoonify) \n\n![photo](../master/photos/raspi-camera-cartoons.jpg)\n\nThe software can run both on a desktop environment (OSX, Linux) such as a laptop, or an embedded environment on a raspberry pi. \n\n### Desktop installation (only tested on OSX and linux)\n\n- Requirements:\n    * Python 2.7*\n    * Cairo (on OSX `brew install cairo`)\n- install dependencies using `pip install -r requirements_desktop.txt` from the `cartoonify` subdirectory.\n- run app from command line using `python run.py`.\n- select 'yes' when asked to download the cartoon dataset (~5GB) and tensorflow model (~100MB).\n- close the app using ctrl-C once the downloads have finished.\n- start the app again using `cartoonify`.\n- you will be prompted to enter the filepath to an image for processing. Enter the absolute filepath surrounded by double quotes.\n\n*Unfortunately python 2.7 is required because the correct python 3 wheels are not available for both the pi and desktop.\n\n### Raspberry pi wiring\n\nThe following wiring diagram will get you started with a shutter button and a status LED.\nIf the software is working correctly, the status LED should light up for 2-3 seconds when the shutter is pressed\nwhile the raspi is processing an image. If the light stays on, something has gone wrong (most likely the camera is unplugged).\n\n__IMPORTANT NOTE__ the diagram below shows AA cells, however this is not correct. You must use eneloop cells to power the camera - these cells\ndeliver 1.2V each, as well as enough current to drive the raspi and thermal printer.\n\n![Wiring diagram](../master/schematics/cartoon_camera_schematic_bb.png)\n\n### Raspberry pi installation\n\n- requirements:\n    * raspberry pi 3\n    * rasbian stretch image on 16gb SD card (8gb too small)\n    * internet access on the raspi\n    * pip + python\n    * raspi camera v2\n    * a button, led, 220 ohm resistor and breadboard\n    * (optional) Thermal printer to suit a raspi 3. I used [this printer here](https://www.adafruit.com/product/2751).\n    Note you will need to use the printer TTL serial interface as per the wiring diagram above, rather than USB.\n\n- install docker on the raspi by running: `curl -sSL https://get.docker.com | sh`\n- set up and enable the raspi camera through `raspi-config`\n- clone the source code from this repo\n- run `./raspi-build.sh`. This will download the google quickdraw dataset and tensorflow model,\nthen build the required docker image.\n- run `./raspi-run.sh`. This will start the docker image.\n\n\n### Troubleshooting\n\n- Check the log files in the `cartoonify/logs` folder for any error messages.\n- The most common issue when running on a raspi is not having the camera plugged in correctly.\n- If nothing is printing, check the logs then check whether images are being saved to `cartoonify/images`.\n- Check that you can manually print something from the thermal printer from the command line.\n\n","funding_links":[],"categories":["Python","\u003ca id=\"tag-graphics\" href=\"#tag-graphics\"\u003eGraphics\u003c/a\u003e","创意 \u003ca name=\"idea\"\u003e\u003c/a\u003e"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmacnish%2Fcartoonify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanmacnish%2Fcartoonify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmacnish%2Fcartoonify/lists"}