Skip to content

Conversation

@yt-koike
Copy link

@yt-koike yt-koike commented Dec 17, 2025

This PR introduces a Dockerfile and compose.yml to simplify installation.
It also adds gradio_web.py to provide a web-based interface for improved usability.

@yt-koike yt-koike mentioned this pull request Dec 17, 2025
@detrin
Copy link

detrin commented Dec 17, 2025

Thanks for the fast PR, I really appreciate that.

@LENZAPP
Copy link

LENZAPP commented Dec 17, 2025

hm ?!

.dockerignore
.gitignore
*.md
Dockerfile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker

Euda1mon1a pushed a commit to Euda1mon1a/ml-sharp that referenced this pull request Dec 28, 2025
Add containerized deployment with NVIDIA CUDA support and a Gradio-based
web interface for easier usage. Based on community PR apple#13.
RUN .venv/bin/pip install -r requirements.txt
RUN .venv/bin/pip install gradio
RUN ln -s /app/.venv/bin/sharp /usr/local/bin/sharp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENV FORCE_CUDA="1"
RUN .venv/bin/pip install ninja
RUN .venv/bin/pip install -r requirements.txt

"-i", input_path,
"-o", "/app/data/output",
"--render"
]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd = [
"sharp", "predict",
"-i", input_path,
"-o", "/app/data/output",
"--render"
]

print(f"Error running sharp: {e}")
print(f"Stdout: {e.stdout.decode()}")
print(f"Stderr: {e.stderr.decode()}")
return None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try:
    t = time.time()
    print("Sharp started")
    subprocess.run(cmd, check=True, capture_output=True)
    print(f"Sharp command took {round(time.time() - t, 3)} seconds")
except subprocess.CalledProcessError as e:
    print(f"Error running sharp: {e}")
    print(f"Stdout: {e.stdout.decode()}")
    print(f"Stderr: {e.stderr.decode()}")
    return None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants