|
1 | 1 | # pytc-client |
2 | 2 |
|
3 | | -## Docker installation instructions |
| 3 | +## Quickstart (uv workflow) |
4 | 4 |
|
5 | | -```bash |
6 | | -# Pull the image (tag 0.0.1 -- subject to change in future versions) |
7 | | -docker pull xbalbinus/pytc-client:0.0.1 |
8 | | -# Expose ports to run the backend servers on Docker |
9 | | -docker run -it -p 4242:4242 -p 4243:4243 -p 4244:4244 -p 6006:6006 --shm-size=8g xbalbinus/pytc-client:0.0.1 |
10 | | -``` |
| 5 | +**Prerequisites** |
| 6 | +- [git](https://git-scm.com/) |
| 7 | +- [uv](https://docs.astral.sh/uv/) (bundles Python and virtualenv management) |
| 8 | +- [Node.js](https://nodejs.org/) 18+ (includes npm) |
11 | 9 |
|
12 | | -## Installation |
13 | | -0. Create a Virtual Environment via. Conda |
| 10 | +Clone the repository and run the bootstrap script once to install everything (Python 3.11 environment, pytorch_connectomics checkout, npm packages): |
14 | 11 |
|
15 | 12 | ```bash |
16 | | -conda create -n pytc python=3.9 |
17 | | -conda activate pytc |
18 | | -conda install pytorch torchvision cudatoolkit=11.3 -c pytorch |
| 13 | +./scripts/bootstrap.sh # macOS / Linux |
| 14 | +scripts\bootstrap.ps1 # Windows (PowerShell) |
19 | 15 | ``` |
20 | 16 |
|
21 | | -Alternatively, dependencies can be installed with native Python via. the following: |
| 17 | +Launch the full stack (both FastAPI services + Electron client) with a single command: |
22 | 18 |
|
23 | 19 | ```bash |
24 | | -# Create a venv |
25 | | -python -m venv .venv |
26 | | -# if running in windows, replace the line above with '.\.venv\Scripts\activate.bat' |
27 | | -source .venv/bin/activate |
28 | | - |
29 | | -# Install dependencies |
30 | | -pip install torch torchvision cuda-python |
| 20 | +./start.sh # macOS / Linux |
| 21 | +start.bat # Windows (CMD) |
31 | 22 | ``` |
32 | 23 |
|
33 | | -In the rare event that your device does not support CUDA, you may run the following respectively: |
34 | | - |
35 | | -```bash |
36 | | -# If using a conda environment |
37 | | -conda create -n pytc python=3.9 |
38 | | -conda activate pytc |
39 | | -conda install pytorch torchvision |
40 | | - |
41 | | -# If installing via native python |
42 | | -python -m venv .venv |
43 | | -source .venv/bin/activate |
44 | | -# if running in windows, replace the line above with '.\.venv\Scripts\activate.bat' |
45 | | -pip install torch torchvision |
46 | | -``` |
47 | | - |
48 | | -1. Client |
49 | | -```bash |
50 | | -cd client |
51 | | -npm install |
52 | | -npm run build |
53 | | -``` |
54 | | - |
55 | | -2. API Server: |
56 | | -```bash |
57 | | -cd server_api |
58 | | -pip install -r requirements.txt |
59 | | -``` |
| 24 | +The launcher keeps the API services running while Electron is open and cleans them up when you exit. |
60 | 25 |
|
61 | | -3. Pytc-connectomics: |
| 26 | +## Alternate Setups |
62 | 27 |
|
63 | | -In root folder, |
64 | | -```bash |
65 | | -# The setup script will automatically download pytorch_connectomics at commit 20ccfde (version 1.0) |
66 | | -./setup_pytorch_connectomics.sh |
67 | | -cd pytorch_connectomics |
68 | | -pip install --editable . |
69 | | -``` |
70 | | - |
71 | | -Alternatively, you can run this manually: |
72 | | -```bash |
73 | | -git clone https://github.com/zudi-lin/pytorch_connectomics.git |
74 | | -cd pytorch_connectomics |
75 | | -git checkout 20ccfde |
76 | | -pip install --editable . |
77 | | -``` |
78 | | - |
79 | | -## Run Project |
80 | | -### To run |
81 | | -```bash |
82 | | -# if running on mac or linux: |
83 | | -./start.sh |
84 | | - |
85 | | -# if running on windows: |
86 | | -./start.bat |
87 | | - |
88 | | -``` |
89 | | -In a separate terminal |
90 | | -```bash |
91 | | -cd client |
92 | | -npm run electron |
93 | | -``` |
| 28 | +- **Docker**: `docker pull xbalbinus/pytc-client:0.0.1` followed by `docker run -it -p 4242:4242 -p 4243:4243 -p 4244:4244 -p 6006:6006 --shm-size=8g xbalbinus/pytc-client:0.0.1` |
| 29 | +- **Manual Python environment**: still supported—create/activate your own virtualenv, run `pip install -r server_api/requirements.txt`, execute `setup_pytorch_connectomics.sh`, and install the package with `pip install -e pytorch_connectomics`. |
94 | 30 |
|
95 | | -Below is a link to a video demo: showing how to set up and run the app: |
96 | | -[video demo](https://www.loom.com/share/45c09b36bf37408fb3e5a9172e427deb?sid=2777bf8f-a705-4d47-b17a-adf882994168) |
| 31 | +## Video Demo |
| 32 | +[Video walkthrough](https://www.loom.com/share/45c09b36bf37408fb3e5a9172e427deb?sid=2777bf8f-a705-4d47-b17a-adf882994168) |
0 commit comments