{"id":18228128,"url":"https://github.com/meetptl04/imagestyletranfer","last_synced_at":"2026-04-28T08:06:02.317Z","repository":{"id":261000194,"uuid":"851711939","full_name":"meetptl04/ImageStyleTranfer","owner":"meetptl04","description":"This project demonstrates how to apply neural style transfer using TensorFlow and a pre-trained VGG19 model. The goal is to combine the content of one image with the style of another to create a stylized image. The repository includes code for image processing, loss computation, style transfer, and visualization","archived":false,"fork":false,"pushed_at":"2024-11-07T05:13:13.000Z","size":34336,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T07:57:28.349Z","etag":null,"topics":["image-processing","jupyter-notebook","keras","matplotlib","tenserflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/meetptl04.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-09-03T15:28:25.000Z","updated_at":"2024-11-07T05:13:16.000Z","dependencies_parsed_at":"2024-12-21T20:33:52.368Z","dependency_job_id":null,"html_url":"https://github.com/meetptl04/ImageStyleTranfer","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"28798c0c376b6c95c6014eeda8011db184a1c337"},"previous_names":["meetptl04/imagestyletranfer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetptl04%2FImageStyleTranfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetptl04%2FImageStyleTranfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetptl04%2FImageStyleTranfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetptl04%2FImageStyleTranfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meetptl04","download_url":"https://codeload.github.com/meetptl04/ImageStyleTranfer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801173,"owners_count":20998332,"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":["image-processing","jupyter-notebook","keras","matplotlib","tenserflow"],"created_at":"2024-11-04T07:04:03.540Z","updated_at":"2026-04-28T08:05:57.218Z","avatar_url":"https://github.com/meetptl04.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Style Transfer\n\nThis project implements image style transfer using TensorFlow and a pre-trained VGG19 model. It features an interactive UI for uploading images and adjusting style transfer parameters, along with comprehensive image processing and visualization capabilities.\n\n## Overview\n\nThe project consists of several key components:\n\n1. **Image Processing**: Advanced tensor processing and image manipulation for neural network compatibility\n2. **Loss Functions**: Sophisticated implementations of content and style losses using gram matrices\n3. **VGG Model**: Customized VGG19 model with carefully selected layers for feature extraction\n4. **Style Transfer**: Core implementation with adjustable weights and interactive parameter tuning\n5. **Visualization**: Interactive UI with image upload capabilities and real-time parameter adjustment\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Dependencies](#dependencies)\n- [Components](#components)\n  - [ImageProcessing](#imageprocessing)\n  - [LossFunctions](#lossfunctions)\n  - [VGGModel](#vggmodel)\n  - [StyleTransfer](#styletransfer)\n  - [Visualization](#visualization)\n- [Results](#results)\n- [License](#license)\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/meetptl04/ImageStyleTranfer.git\ncd ImageStyleTranfer\n```\n\n2. Install dependencies:\n```bash\npip install tensorflow matplotlib numpy ipywidgets\n```\n\n## Dependencies\n\n- TensorFlow 2.x\n- NumPy\n- Matplotlib\n- IPython/Jupyter\n- ipywidgets\n\n## Components\n\n### ImageProcessing\n\nHandles image loading, processing, and tensor conversion:\n\n```python\nclass ImageProcessing:\n    @staticmethod\n    def load_and_process_tensor(image_tensor):\n        # Process and normalize image tensor\n        # Returns preprocessed tensor for VGG19\n        pass\n\n    @staticmethod\n    def deprocess_img(processed_img):\n        # Convert processed image back to viewable format\n        pass\n```\n\n### LossFunctions\n\nImplements loss calculations for style transfer:\n\n```python\nclass LossFunctions:\n    @staticmethod\n    def gram_matrix(input_tensor):\n        # Calculate gram matrix for style features\n        pass\n\n    @staticmethod\n    def get_style_loss(base_style, gram_target):\n        # Compute style loss between base and target\n        pass\n```\n\n### VGGModel\n\nVGG19 model setup for feature extraction:\n\n```python\nclass VGGModel:\n    def __init__(self):\n        self.model = self._get_model()\n        \n    def _get_model(self):\n        # Initialize VGG19 and configure layers\n        # Returns model with selected outputs\n        pass\n```\n\n### StyleTransfer\n\nCore style transfer implementation:\n\n```python\nclass StyleTransfer:\n    def __init__(self, vgg_model):\n        self.vgg_model = vgg_model\n        self.style_weight = 1e-2\n        self.content_weight = 1e4\n\n    def compute_loss(self, init_image, gram_style_features, content_features):\n        # Compute style and content losses\n        pass\n\n    def run_style_transfer(self, content_image, style_image, num_iterations=300):\n        # Execute style transfer process\n        pass\n```\n\n### Visualization\n\nInteractive UI implementation:\n\n```python\nclass Visualization:\n    def __init__(self, style_transfer):\n        self.style_transfer = style_transfer\n        self.current_style_weight = 1e-2\n        self.current_content_weight = 1e3\n\n    def style_transfer_ui(self):\n        # Create and display interactive UI elements\n        pass\n```\n\n## Interactive UI Features\n\nThe project includes an interactive UI with:\n\n1. **Image Upload Widgets**\n   - Content image upload\n   - Style image upload\n   - Drag-and-drop support\n\n2. **Parameter Controls**\n   - Style weight slider (1e-4 to 1e0)\n   - Content weight slider (1e2 to 1e4)\n   - Real-time weight adjustment\n\n3. **Progress Monitoring**\n   - Loss value display\n   - Iteration progress\n   - Status messages\n\n4. **Result Visualization**\n   - Side-by-side image display\n   - Original images\n   - Generated style transfer result\n\n## Usage Example\n\n```python\n# Initialize components\nvgg_model = VGGModel()\nstyle_transfer = StyleTransfer(vgg_model)\nvisualizer = Visualization(style_transfer)\n\n# Launch interactive UI\nvisualizer.style_transfer_ui()\n```\n\n## Results\n\nThe style transfer process produces three images:\n1. Content Image: The base image whose content will be preserved\n2. Style Image: The image whose style will be transferred\n3. Result Image: The final stylized image combining content and style\n\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeetptl04%2Fimagestyletranfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeetptl04%2Fimagestyletranfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeetptl04%2Fimagestyletranfer/lists"}