Commit
·
eac929d
1
Parent(s):
59b6ca1
Initial protype
Browse files- Dockerfile +36 -0
- README.md +19 -1
- app/assets/van.png +0 -0
- app/main.py +76 -0
- requirements.txt +1 -0
Dockerfile
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
From ubuntu:latest
|
| 2 |
+
|
| 3 |
+
RUN apt update
|
| 4 |
+
RUN apt install python3 python3-pip -y
|
| 5 |
+
|
| 6 |
+
##################################################
|
| 7 |
+
# Ubuntu setup
|
| 8 |
+
##################################################
|
| 9 |
+
|
| 10 |
+
RUN apt-get update \
|
| 11 |
+
&& apt-get install -y wget \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
RUN apt-get update && apt-get -y upgrade \
|
| 15 |
+
&& apt-get install -y --no-install-recommends \
|
| 16 |
+
unzip \
|
| 17 |
+
nano \
|
| 18 |
+
git \
|
| 19 |
+
g++ \
|
| 20 |
+
gcc \
|
| 21 |
+
htop \
|
| 22 |
+
zip \
|
| 23 |
+
ca-certificates \
|
| 24 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
+
|
| 26 |
+
##################################################
|
| 27 |
+
# ODTP setup
|
| 28 |
+
##################################################
|
| 29 |
+
|
| 30 |
+
RUN mkdir /app
|
| 31 |
+
COPY . /digiwild
|
| 32 |
+
RUN pip install -r /digiwild/requirements.txt
|
| 33 |
+
|
| 34 |
+
WORKDIR /digiwild
|
| 35 |
+
|
| 36 |
+
ENTRYPOINT bash
|
README.md
CHANGED
|
@@ -1 +1,19 @@
|
|
| 1 |
-
# digiwild
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# digiwild
|
| 2 |
+
|
| 3 |
+
## Docker
|
| 4 |
+
|
| 5 |
+
```
|
| 6 |
+
docker build -t ordes/digiwild:swallow .
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
```
|
| 10 |
+
docker run -it -p 7860:7860 ordes/digiwild:swallow
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
## Needs
|
| 14 |
+
|
| 15 |
+
- Camera with multiples pictures?
|
| 16 |
+
- Uploading of pics
|
| 17 |
+
- GPS location
|
| 18 |
+
- Comments
|
| 19 |
+
- Symptomps selection (Dropdown)
|
app/assets/van.png
ADDED
|
app/main.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def Dropdown_update(category):
|
| 6 |
+
print(category)
|
| 7 |
+
|
| 8 |
+
options_a = ["C","D","E"]
|
| 9 |
+
options_b = ["C","D","E"]
|
| 10 |
+
options_c = ["C","D","E"]
|
| 11 |
+
|
| 12 |
+
if category == "category_a":
|
| 13 |
+
return gr.Dropdown.update(choices=options_a)
|
| 14 |
+
elif category == "category_b":
|
| 15 |
+
return gr.Dropdown.update(choices=options_b)
|
| 16 |
+
elif category == "category_c":
|
| 17 |
+
return gr.Dropdown.update(choices=options_c)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def truck_dropdown():
|
| 21 |
+
return gr.Dropdown(choices=["A", "B", "C", "D"], label="Dropdown1", interactive=True)
|
| 22 |
+
|
| 23 |
+
def truckb_dropdown():
|
| 24 |
+
return gr.Dropdown(choices=["F", "W", "Z", "X"], label="Dropdown2", interactive=True)
|
| 25 |
+
|
| 26 |
+
choices = ["A", "B", "C", "D"]
|
| 27 |
+
|
| 28 |
+
with gr.Blocks() as demo:
|
| 29 |
+
with gr.Row():
|
| 30 |
+
with gr.Column(scale=1):
|
| 31 |
+
title = gr.Markdown("# Welcome to Digiwild", label="Title")
|
| 32 |
+
description = gr.Markdown("Lorem ipsum", label="description")
|
| 33 |
+
|
| 34 |
+
with gr.Row():
|
| 35 |
+
with gr.Column(scale=1):
|
| 36 |
+
camera = gr.Image()
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
with gr.Column(scale=1):
|
| 40 |
+
gr.Radio(choices=["Wounded", "Dead"], label="State of the animal")
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
with gr.Row():
|
| 44 |
+
with gr.Column(scale=1):
|
| 45 |
+
img1 = gr.Image(value='./assets/van.png', show_download_button=False, show_label=False)
|
| 46 |
+
butt1 = gr.Button("Violently hit by a drunk driver")
|
| 47 |
+
# dropdown1 = gr.Dropdown(choices=choices, label="Dropdown")
|
| 48 |
+
|
| 49 |
+
with gr.Column(scale=1):
|
| 50 |
+
img1 = gr.Image(value='./assets/van.png', show_download_button=False, show_label=False)
|
| 51 |
+
butt2 = gr.Button("Violently hit by two drunk drivers")
|
| 52 |
+
# dropdown2 = gr.Dropdown(choices=choices, label="Dropdown")
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
with gr.Row():
|
| 56 |
+
with gr.Column(scale=1):
|
| 57 |
+
img3 = gr.Image(value='./assets/van.png', show_download_button=False, show_label=False)
|
| 58 |
+
# dropdown3 = gr.Dropdown(choices=choices, label="Dropdown")
|
| 59 |
+
|
| 60 |
+
with gr.Column(scale=1):
|
| 61 |
+
img4 = gr.Image(value='./assets/van.png', show_download_button=False, show_label=False)
|
| 62 |
+
# dropdown4 = gr.Dropdown(choices=choices, label="Dropdown")
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
with gr.Row():
|
| 67 |
+
dropdown = gr.Dropdown(choices=["A","B"], label="Dropdown", interactive=True)
|
| 68 |
+
|
| 69 |
+
with gr.Column(scale=1):
|
| 70 |
+
subbutt = gr.Button("Submit")
|
| 71 |
+
output_message = gr.Markdown("Thank you, you didn't save this one but you could save the next")
|
| 72 |
+
|
| 73 |
+
butt1.click(truck_dropdown, outputs=dropdown)
|
| 74 |
+
butt2.click(truckb_dropdown, outputs=dropdown)
|
| 75 |
+
|
| 76 |
+
demo.launch(server_name="0.0.0.0")
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
gradio
|