Spaces:
Runtime error
Runtime error
try
Browse files- .gitignore +1 -0
- __pycache__/share_btn.cpython-38.pyc +0 -0
- app.py +36 -0
- sketch.js +10 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv/
|
__pycache__/share_btn.cpython-38.pyc
ADDED
Binary file (6.31 kB). View file
|
|
app.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from diffusers import AutoPipelineForText2Image
|
2 |
+
import torch
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
pipeline = AutoPipelineForText2Image.from_pretrained('dataautogpt3/OpenDalleV1.1', torch_dtype=torch.float16)
|
6 |
+
|
7 |
+
text0 = 'black fluffy gorgeous dangerous cat animal creature, large orange eyes, big fluffy ears, piercing gaze, full moon, dark ambiance, best quality, extremely detailed'
|
8 |
+
|
9 |
+
def generation(text):
|
10 |
+
image = pipeline(text).images[0]
|
11 |
+
return image
|
12 |
+
|
13 |
+
demo = gr.Blocks()
|
14 |
+
|
15 |
+
title = '# 3D print failures detection App'
|
16 |
+
description = 'App for detect errors in the 3D printing'
|
17 |
+
|
18 |
+
with demo:
|
19 |
+
gr.Markdown(title)
|
20 |
+
gr.Markdown(description)
|
21 |
+
|
22 |
+
with gr.Row():
|
23 |
+
img_input = gr.Textbox ( label="Text 1",info="Initial text",lines=5,value=text0)
|
24 |
+
|
25 |
+
button = gr.Button(value="Reverse")
|
26 |
+
|
27 |
+
|
28 |
+
with gr.Row():
|
29 |
+
img_output= gr.Image()
|
30 |
+
|
31 |
+
button.click( generation, inputs=img_input, outputs=[img_output])
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
if __name__ == "__main__":
|
36 |
+
demo.launch()
|
sketch.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// PARAMS are embedded here
|
2 |
+
|
3 |
+
function setup() {
|
4 |
+
createCanvas(WIDTH, HEIGHT);
|
5 |
+
}
|
6 |
+
|
7 |
+
function draw() {
|
8 |
+
background(BACKGROUND_COLOR);
|
9 |
+
circle(mouseX, mouseY, CIRCLE_SIZE);
|
10 |
+
}
|