-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
97 lines (85 loc) · 1.87 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<title>Removebg example using onnxruntime-web</title>
<style>
body,
html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
}
#dropArea {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px dashed #ccc;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
transition: background-color 0.3s;
}
#dropArea.hover {
background-color: #ebe8e7;
}
#dropArea p {
font-size: 20px;
color: #666;
}
canvas {
display: block;
}
#loadingSpinner {
display: none;
position: absolute;
width: 64px;
height: 64px;
border: 4px solid #ccc;
border-top: 4px solid #f44336;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#removeButton {
display: none;
position: absolute;
bottom: 32px;
right: 32px;
background-color: #f44336;
color: white;
border: none;
border-radius: 50%;
width: 64px;
height: 64px;
font-size: 24px;
cursor: pointer;
}
</style>
</head>
<body>
<div id="loadingSpinner"></div>
<div id="dropArea">
<p>Drag & Drop an image here or click to upload</p>
<input type="file" id="imageInput" accept="image/*" style="display:none;" />
</div>
<canvas id="imageCanvas"></canvas>
<button id="removeButton">×</button>
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js"></script>
<script src="script.js"></script>
</body>
</html>