-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_and_run.sh
40 lines (32 loc) · 944 Bytes
/
setup_and_run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Name of the virtual environment
ENV_NAME=cellpose-gradio-env
# Check if Python is installed
if ! command -v python3 &> /dev/null
then
echo "Python is not installed or not in the system PATH."
echo "Please install Python and try again."
exit 1
fi
# Create the virtual environment
echo "Creating virtual environment: $ENV_NAME"
python3 -m venv $ENV_NAME
if [ $? -ne 0 ]; then
echo "Failed to create virtual environment."
exit 1
fi
# Activate the environment
source $ENV_NAME/bin/activate
if [ $? -ne 0 ]; then
echo "Failed to activate virtual environment."
exit 1
fi
# Install required packages
echo "Installing required packages..."
pip install numpy matplotlib pillow gradio seaborn cellpose tifffile werkzeug io jsonschema
# Launch the Gradio app
echo "Launching Cellpose Gradio app..."
python Cellpose_gradio.py
# Deactivate the environment
deactivate
echo "Setup complete and app launched."