Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update entrypoint.sh #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docker/files/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status,
# print each command before executing (for debugging), and treat unset variables as an error.
set -eux

# Set default values for DEVICE and MODEL if they are not provided
DEVICE=${DEVICE:-cuda}
MODEL=${MODEL:-MASt3R_ViTLarge_BaseDecoder_512_dpt.pth}

# Log the device and model being used
echo "Running MASt3R demo with:"
echo "Model: $MODEL"
echo "Device: $DEVICE"

# Check if the model file exists in the checkpoints directory
if [ ! -f "checkpoints/$MODEL" ]; then
echo "Error: Model file 'checkpoints/$MODEL' does not exist."
exit 1
fi

# Execute the Python script with provided arguments
exec python3 demo.py --weights "checkpoints/$MODEL" --device "$DEVICE" --local_network "$@"