ClipCraft: Image Background Remover
Tags: githubhack23, python, machinelearning
Published: 2023-05-24 01:30:58

## What I built 

For this hackathon, I built a lightweight image background remover that can be installed as a PWA. It comes as part of a suite of media editing mini apps.

### Category Submission: 

Phone Friendly: Projects built for Mobile (PWA readiness, iOS/Android)

### App Link
[ClipCraft Studio](https://clipcraft.studio)

{% embed https://clipcraft.studio %}

### Screenshots 

![App Store](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8649gxufotp7giisgh8d.png)


![Clipper Mini App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1phzmyuvi0utjjmfcfgb.png)


![Image upload](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i85c0l8gzuezd8qw40dp.png)



![Clipped Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lwl97bq7dw3bvda7zehq.png)

{% embed https://youtu.be/aKuFXw8ol14 %}

### Description 

This app is a handy tool that focuses on simplifying various aspects of media editing. With its U2net-powered background removal feature, users can remove backgrounds from their images, making them more versatile and visually appealing. The app's backend is built using Python Flask, ensuring a smooth and reliable user experience.

In addition to the background removal feature, the app also offers multiple mini apps to enhance your media editing capabilities. Soon, you can expect the addition of a photo filter mini app, which will allow you to add creative filters to your images. Furthermore, the app will introduce a photo dump video creator, enabling you to compile your photos into engaging videos. Another exciting feature in the pipeline is the Podclip mini app, which utilizes the OpenAI Whisper model to generate transcriptions and create short videos from podcast audio clips. Lastly, the app will include a convenient Clipshare mini app that simplifies media sharing across devices through the use of QR codes. 


### Link to Source Code 
[Backend](https://github.com/perplexedyawdie/clipcraft-u2net-flask)
[Frontend](https://github.com/perplexedyawdie/clip-craft)

### Permissive License 
MIT

## Background (What made you decide to build this particular app? What inspired you?) 

It all started when I began researching and playing around with AI tools. As I delved deeper into the world of artificial intelligence, I discovered the incredible potential and versatility of different types of models and their various use cases. One area that particularly caught my attention was media editing. I stumbled upon some fascinating models that could perform tasks like background removal seamlessly. The possibilities seemed endless, and I was inspired to build an app that could harness this power and make media editing more accessible and user-friendly. That's how the idea took shape.


### How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?) 

When it came to utilizing GitHub Actions and GitHub Codespaces for my project, I found them to be invaluable tools in streamlining the development and deployment process. With GitHub Actions, I was able to create a multi-architecture container build effortlessly, ensuring compatibility across different environments. Moreover, GitHub Actions also facilitated pushing the container to GitHub Container Registry (ghcr) smoothly, making it readily accessible for deployment. Speaking of deployment, I relied on GitHub Actions once again to deploy the container to my server seamlessly. These powerful features provided an efficient and automated workflow, saving me time and effort.

Throughout this journey, I learned a great deal. One notable aspect was working with the U2NET model for salient object detection, specifically for background removal. It was fascinating to explore the capabilities of this model and see how well it performs. Additionally, I picked up a new skill in utilizing Onnxruntime, which allowed me to easily deploy the U2NET model in different environments. However, it wasn't without its challenges. I encountered numerous obstacles when deploying the model, and the experience taught me a valuable lesson about the intricacies and potential pitfalls involved in deploying AI models. Nevertheless, this entire process has been incredibly enriching, from exporting models to ONNX format to setting up Onnxruntime in Python, and it has deepened my understanding of deploying models effectively. Ultimately, my aim remains to move everything client-side, and with the skills and knowledge gained, I'm optimistic about achieving that goal.

### Additional Resources/Info

[Onnxruntime](https://onnxruntime.ai/)
[U2-net](https://github.com/xuebinqin/U-2-Net)