Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -32
Dockerfile
CHANGED
|
@@ -1,36 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 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 |
-
|
| 19 |
-
|
| 20 |
-
return output
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 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 |
-
|
| 35 |
-
|
| 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"]
|