SoDa12321 commited on
Commit
d356344
·
verified ·
1 Parent(s): 23bb9eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -32
Dockerfile CHANGED
@@ -1,36 +1,23 @@
1
- import gradio as gr
2
- import subprocess
3
 
4
- def deblur_image(input_image_path, angle_model_path, length_model_path):
5
- command = [
6
- "python",
7
- "deblur_img.py",
8
- "--image",
9
- input_image_path,
10
- "--angle_model",
11
- angle_model_path,
12
- "--length_model",
13
- length_model_path
14
- ]
15
- result = subprocess.run(command, capture_output=True, text=True)
16
- return result.stdout
17
 
18
- def deblur_and_display(input_image, angle_model_path, length_model_path):
19
- output = deblur_image(input_image.name, angle_model_path, length_model_path)
20
- return output
21
 
22
- iface = gr.Interface(
23
- fn=deblur_and_display,
24
- inputs=[
25
- gr.inputs.Image(label="Upload Image"),
26
- gr.inputs.Textbox(label="Angle Model Path", default="/app/pretrained_models/angle_model.hdf5"),
27
- gr.inputs.Textbox(label="Length Model Path", default="/app/pretrained_models/length_model.hdf5")
28
- ],
29
- outputs="text",
30
- title="Image Deblurring App",
31
- description="Upload an image to deblur it."
32
- )
33
 
34
- if __name__ == "__main__":
35
- iface.launch()
36
-
 
 
 
 
 
 
 
 
 
1
+ # Use the Hugging Face Docker image as a parent image
2
+ FROM huggingface/autotrain-advanced:latest
3
 
4
+ # Install Gradio
5
+ RUN pip install gradio
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ # Set the working directory
8
+ WORKDIR /app
 
9
 
10
+ # Install git
11
+ RUN apt-get update && apt-get install -y git
 
 
 
 
 
 
 
 
 
12
 
13
+ # Clone the repository
14
+ RUN git clone https://github.com/ankitVP77/Blind-Motion-Deblurring-for-Legible-License-Plates-using-Deep-Learning.git /app
15
+
16
+ # Install dependencies
17
+ RUN pip install --no-cache-dir tensorflow numpy opencv-python-headless matplotlib
18
+
19
+ # Expose the port the app runs on
20
+ EXPOSE 7860
21
+
22
+ # Command to launch Gradio interface
23
+ CMD ["python", "app.py"]