{"id":19614917,"url":"https://github.com/mirtia/artstyle-detector","last_synced_at":"2025-10-13T18:43:28.382Z","repository":{"id":176962723,"uuid":"657774687","full_name":"Mirtia/ArtStyle-Detector","owner":"Mirtia","description":"A project aiming to detect artstyles from images. It queries Wikimedia Commons to collect images for the training set.","archived":false,"fork":false,"pushed_at":"2023-07-15T21:02:19.000Z","size":16948,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-24T06:59:47.346Z","etag":null,"topics":["crawling","image-processing","wikimedia"],"latest_commit_sha":null,"homepage":"","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/Mirtia.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-23T20:28:14.000Z","updated_at":"2025-06-18T16:30:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4d9ecfc-4e80-4f4d-a696-25ef9ffb0ed0","html_url":"https://github.com/Mirtia/ArtStyle-Detector","commit_stats":null,"previous_names":["mirtia/artstyle-detector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mirtia/ArtStyle-Detector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirtia%2FArtStyle-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirtia%2FArtStyle-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirtia%2FArtStyle-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirtia%2FArtStyle-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mirtia","download_url":"https://codeload.github.com/Mirtia/ArtStyle-Detector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirtia%2FArtStyle-Detector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263060931,"owners_count":23407596,"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":["crawling","image-processing","wikimedia"],"created_at":"2024-11-11T10:54:29.949Z","updated_at":"2025-10-13T18:43:23.361Z","avatar_url":"https://github.com/Mirtia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Artstyle Detector\n\nTo make an artstyle detector, I first had to find enough images for the training.\nThe following are the list of the sources I *used* or at least tried to use to gather a bunch of images.\n\n## Example\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e \u003cimg src=\"tests/monet_impressionism.jpg\" alt=\"image\"\u003e\n    \u003ctd valign=\"top\"\u003e    \u003cpre\u003e\u003ccode class=\"language-shell\"\u003e\n# i : input image, o : model path\npython src/main.py -i tests/monet_impressionism.jpg -o styles/\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\u003e\nPredictions for image: tests/monet_impressionism.jpg\n============================================================\nneo_impressionism : 48.7353\nimpressionism : 46.3269\npost_impressionism : 1.6898\npre_raphaelite_brotherhood : 1.5794\nnaive_art_primitivism : 0.4833\nrealism : 0.3755\nexpressionism : 0.3007\nromanticism : 0.2878\nsurrealism : 0.153\nabstract_expressionism : 0.0682\n============================================================\n    \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n## Google Images\n\nThe first approach may not always be the best (it's never). To crawl Google Images I had to use [Google API](https://console.cloud.google.com/apis/library), make a custom [Programmable Search engine](https://developers.google.com/custom-search) and also be under a limit of requests. I didn't look at it further but made a test run.\n\n## Wikimedia\n\nExample of wikimedia categories *Impressionist_paintings*. The way I crawled this was pretty stupid but honest (bs4s, asyncio classic). Why? I could try an approach using SPARQL queries at [Wikidata Query Service](https://query.wikidata.org/). I may implement it in the future.\n\n## Wikiart\n\nAs the wikimedia images were not enough ?!, I tried another approach. I found Wikiart which seemed to have an adequate amount of images at first glance. Luckily, there was a [repository](https://github.com/asahi417/wikiart-image-dataset) working on this, so I downloaded the datasets by the links provided.\n\n## Detecting style\n\nTo train the model I used [ImageAI](https://github.com/OlafenwaMoses/ImageAI/tree/master). After writing some functionalities to construct the directory structure, training was pretty straightforward.\n\nI was not satisfied with the accuracy it achieved but it was probably because of the dataset similarities. I'll try to use more categories in the future.\n\nTruth is, a painting can have multiple arstyles. I tested some pictures, as welll as some of my own, and the results were okayish, but with not high confidence most of the times.\n\n## Palette extractor\n\nI used [color-thief](https://github.com/fengsp/color-thief-py) to extract paletters and dominant colors from the images. I am still not sure what to do with this information but it was cool. I thought about organizing the images to clusters according to their palette range.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirtia%2Fartstyle-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirtia%2Fartstyle-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirtia%2Fartstyle-detector/lists"}