Update app.py
Browse files
app.py
CHANGED
@@ -14,19 +14,30 @@ import gradio as gr
|
|
14 |
import os
|
15 |
|
16 |
|
17 |
-
if gr.__version__ != "3.28.3":
|
18 |
os.system("pip uninstall -y gradio")
|
19 |
os.system("pip install gradio==3.28.3")
|
20 |
|
21 |
description = """
|
22 |
Our project is to use diffusion model to change the texture of our robotic arm simulation.
|
23 |
-
|
24 |
To do so, we first get our simulated images. After, we process these images to get Canny Edge maps. Finally, we can get brand new images by using ControlNet.
|
25 |
-
|
26 |
Therefore, we are able to change our simulation texture, and still keeping the image composition.
|
27 |
|
28 |
|
29 |
Our objectif for the sprint is to perform data augmentation using ControlNet. We then look for having a model that can augment an image quickly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
For now, we benchmarked our model on a node of 4 Titan RTX 24Go. We were able to generate a batch of 4 images in a average time of 1.3 seconds!
|
31 |
We also have access to nodes composed of 8 A100 80Go GPUs. The benchmark on one of these nodes will come soon.
|
32 |
|
|
|
14 |
import os
|
15 |
|
16 |
|
17 |
+
if gr.__version__ != "3.28.3": #doesn't work...
|
18 |
os.system("pip uninstall -y gradio")
|
19 |
os.system("pip install gradio==3.28.3")
|
20 |
|
21 |
description = """
|
22 |
Our project is to use diffusion model to change the texture of our robotic arm simulation.
|
|
|
23 |
To do so, we first get our simulated images. After, we process these images to get Canny Edge maps. Finally, we can get brand new images by using ControlNet.
|
|
|
24 |
Therefore, we are able to change our simulation texture, and still keeping the image composition.
|
25 |
|
26 |
|
27 |
Our objectif for the sprint is to perform data augmentation using ControlNet. We then look for having a model that can augment an image quickly.
|
28 |
+
To do so, we trained many Controlnets from scratch with different datasets :
|
29 |
+
* [Coyo-700M](https://github.com/kakaobrain/coyo-dataset)
|
30 |
+
* [Bridge](https://sites.google.com/view/bridgedata)
|
31 |
+
|
32 |
+
A method to accelerate the inference of diffusion model is by simply generating small images. So we decided to work with low resolution images.
|
33 |
+
After downloading the datasets, we processed them by resizing images to a 128 resolution.
|
34 |
+
The smallest side of the image (width or height) is resized to 128 and the other side is resized keeping the initial ratio.
|
35 |
+
After, we retrieve the Canny Edge Map of the images. We performed this preprocess for every datasets we use during the sprint.
|
36 |
+
|
37 |
+
|
38 |
+
We train four different Controlnets. For each one of them, we processed the datasets differently. You can find the description of the processing in the readme file attached to the model repo
|
39 |
+
[Our ControlNet repo](https://huggingface.co/Baptlem/baptlem-controlnet)
|
40 |
+
|
41 |
For now, we benchmarked our model on a node of 4 Titan RTX 24Go. We were able to generate a batch of 4 images in a average time of 1.3 seconds!
|
42 |
We also have access to nodes composed of 8 A100 80Go GPUs. The benchmark on one of these nodes will come soon.
|
43 |
|