{"id":18324821,"url":"https://github.com/luiscib3r/style_transfer","last_synced_at":"2025-04-06T00:31:06.911Z","repository":{"id":240818902,"uuid":"802278914","full_name":"luiscib3r/style_transfer","owner":"luiscib3r","description":"Style Transfer is an application developed with Flutter that allows users to apply artistic style transformations to images using advanced style transfer models created by Google, as described in their publication Supercharging Style Transfer.","archived":false,"fork":false,"pushed_at":"2024-06-19T00:36:14.000Z","size":12116,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-19T07:24:21.311Z","etag":null,"topics":["flutter","flutter-bloc","flutter-isolate","tensorflow","web","web-worker"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/luiscib3r.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}},"created_at":"2024-05-17T22:08:53.000Z","updated_at":"2024-06-19T00:36:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbcb0ccd-7e85-43fb-94c3-493e20fc504d","html_url":"https://github.com/luiscib3r/style_transfer","commit_stats":null,"previous_names":["luiscib3r/style_transfer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiscib3r%2Fstyle_transfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiscib3r%2Fstyle_transfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiscib3r%2Fstyle_transfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiscib3r%2Fstyle_transfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luiscib3r","download_url":"https://codeload.github.com/luiscib3r/style_transfer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"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":["flutter","flutter-bloc","flutter-isolate","tensorflow","web","web-worker"],"created_at":"2024-11-05T18:35:54.274Z","updated_at":"2025-04-06T00:31:01.897Z","avatar_url":"https://github.com/luiscib3r.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Style Transfer\n\nStyle Transfer is an application developed with Flutter that allows users to apply artistic style transformations to images using advanced style transfer models created by Google, as described in their publication [Supercharging Style Transfer](https://research.google/blog/supercharging-style-transfer/).\n\n## Technical Features\n\n* **Local Inference on Mobile**: In the mobile versions, TensorFlow Lite is used to load the models and perform inference directly on the device. This ensures fast performance and does not rely on an internet connection.\n\n* **Isolates on Mobile**: To avoid blocking the main thread responsible for rendering the user interface (UI), inference and image processing are performed in the background using isolates. This enhances the user experience by keeping the UI responsive.\n\n* **Server-side Inference for Web**: In the web version, inference is handled by sending requests to a server running FastAPI and using TensorFlow to execute the models.\n\n* **Web Workers on Web**: Similar to isolates in the mobile versions, web workers are used in the web version to perform inference and image processing in the background, ensuring the UI remains smooth and responsive.\n\n## Screenshots\n\n### Mobile\n\n|  |  | | |\n| --- | --- | --- | --- |\n| ![Home](screenshots/mobile/1.jpeg) | ![Image](screenshots/mobile/2.jpeg) | ![Styled](screenshots/mobile/3.jpeg) | ![Styled](screenshots/mobile/4.jpeg) |\n\n### Web\n|  |  |\n| --- | --- |\n| ![Home](screenshots/web/1.png) | ![Image](screenshots/web/2.png) | \n![Styled](screenshots/web/3.png) | ![Styled](screenshots/web/4.png) |\n\n## Local deployment using Docker Compose\n\n```bash\ndocker compose up\n```\n\n## Build for web\n\n### Setup service workers api url\n\n```bash\n./build_service_workers.sh http://localhost:8080\n```\n\n### Build web\n\n```bash\nflutter build web\n```\n\n### Run local API\n\nDownload tensorflow lite models to root folder\n\n```bash\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite -o magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite\n\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite -o magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite\n```\n\n```bash\npython -m venv venv\n```\n\n```bash\nsource venv/bin/activate\n```\n\n```bash\npip install -r requirements.txt\n```\n\n```bash\nuvicorn tflite_server:app --host 0.0.0.0 --port 8080\n```\n\n## Build for android\n\n### Download tensorflow lite models to assets folder\n\n```bash\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite -o assets/models/magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite\n\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite -o assets/models/magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite\n```\n\n### Build\n\n```bash\nflutter build apk\n```\n\n## Build for iOS (Development)\n\nYou need to have a macOS device with Xcode to build for iOS.\n\n### Download tensorflow lite models to assets folder\n\n```bash\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite -o assets/models/magenta_arbitrary-image-stylization-v1-256_int8_prediction_1.tflite\n\ncurl https://storage.googleapis.com/download.tensorflow.org/models/tflite/task_library/style_transfer/android/magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite -o assets/models/magenta_arbitrary-image-stylization-v1-256_int8_transfer_1.tflite\n```\n### Build\n\n```bash\nflutter build ios\n```\n\n```bash\nflutter install\n```\n\nFollow the instructions to run the app on your iOS device.\n\nFor more information, see the [iOS | Flutter documentation](https://docs.flutter.dev/deployment/ios).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluiscib3r%2Fstyle_transfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluiscib3r%2Fstyle_transfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluiscib3r%2Fstyle_transfer/lists"}