bla commited on
Commit
0030818
·
verified ·
1 Parent(s): 92767db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -115
app.py CHANGED
@@ -8,121 +8,7 @@ import matplotlib.pyplot as plt
8
  from transformers import AutoModel, AutoProcessor
9
  from ultralytics import YOLO
10
 
11
- # Custom CSS for shadcn/Radix UI inspired look
12
- custom_css = """
13
- :root {
14
- --primary: #0f172a;
15
- --primary-foreground: #f8fafc;
16
- --background: #f8fafc;
17
- --card: #ffffff;
18
- --card-foreground: #0f172a;
19
- --border: #e2e8f0;
20
- --ring: #94a3b8;
21
- --radius: 0.5rem;
22
- }
23
-
24
- .dark {
25
- --primary: #f8fafc;
26
- --primary-foreground: #0f172a;
27
- --background: #0f172a;
28
- --card: #1e293b;
29
- --card-foreground: #f8fafc;
30
- --border: #334155;
31
- --ring: #94a3b8;
32
- }
33
-
34
- .gradio-container {
35
- margin: 0 !important;
36
- padding: 0 !important;
37
- max-width: 100% !important;
38
- }
39
-
40
- .main-container {
41
- background-color: var(--background);
42
- border-radius: var(--radius);
43
- padding: 1.5rem;
44
- }
45
-
46
- .header {
47
- margin-bottom: 1.5rem;
48
- border-bottom: 1px solid var(--border);
49
- padding-bottom: 1rem;
50
- }
51
-
52
- .header h1 {
53
- font-size: 1.875rem;
54
- font-weight: 700;
55
- color: var(--primary);
56
- margin-bottom: 0.5rem;
57
- }
58
-
59
- .header p {
60
- color: var(--card-foreground);
61
- opacity: 0.8;
62
- }
63
-
64
- .tab-nav {
65
- background-color: var(--card);
66
- border: 1px solid var(--border);
67
- border-radius: var(--radius);
68
- padding: 0.25rem;
69
- margin-bottom: 1.5rem;
70
- }
71
-
72
- .tab-nav button {
73
- border-radius: calc(var(--radius) - 0.25rem) !important;
74
- font-weight: 500 !important;
75
- transition: all 0.2s ease-in-out !important;
76
- }
77
 
78
- .tab-nav button.selected {
79
- background-color: var(--primary) !important;
80
- color: var(--primary-foreground) !important;
81
- }
82
-
83
- .input-panel, .output-panel {
84
- background-color: var(--card);
85
- border: 1px solid var(--border);
86
- border-radius: var(--radius);
87
- padding: 1.5rem;
88
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
89
- }
90
-
91
- .gr-button-primary {
92
- background-color: var(--primary) !important;
93
- color: var(--primary-foreground) !important;
94
- border-radius: var(--radius) !important;
95
- font-weight: 500 !important;
96
- transition: all 0.2s ease-in-out !important;
97
- }
98
-
99
- .gr-button-primary:hover {
100
- opacity: 0.9 !important;
101
- }
102
-
103
- .gr-form {
104
- border: none !important;
105
- background: transparent !important;
106
- }
107
-
108
- .gr-input, .gr-select {
109
- border: 1px solid var(--border) !important;
110
- border-radius: var(--radius) !important;
111
- padding: 0.5rem 0.75rem !important;
112
- }
113
-
114
- .gr-panel {
115
- border: none !important;
116
- }
117
-
118
- .footer {
119
- margin-top: 1.5rem;
120
- border-top: 1px solid var(--border);
121
- padding-top: 1rem;
122
- font-size: 0.875rem;
123
- color: var(--card-foreground);
124
- opacity: 0.7;
125
- }"""
126
  # Custom CSS for a more modern UI inspired by NextUI
127
  custom_css = """
128
  :root {
@@ -772,4 +658,5 @@ with gr.Blocks(title="YOLO Vision Suite", css=custom_css) as demo:
772
  )
773
 
774
  if __name__ == "__main__":
775
- demo.launch(share=True) # Set share=True to create a public link
 
 
8
  from transformers import AutoModel, AutoProcessor
9
  from ultralytics import YOLO
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Custom CSS for a more modern UI inspired by NextUI
13
  custom_css = """
14
  :root {
 
658
  )
659
 
660
  if __name__ == "__main__":
661
+ demo.launch(share=True) # Set share=True to create a public link
662
+