CJ Gaspari commited on
Commit
804c8c9
·
2 Parent(s): 6fe70f4 01475c1

Merge pull request #2 from cjgaspari/copilot/add-detailed-setup-guide

Browse files
Files changed (1) hide show
  1. detailed-setup.md +479 -0
detailed-setup.md ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Detailed Setup Guide for SHARP - Beginner's Edition
2
+
3
+ Welcome! This guide will walk you through setting up the SHARP 3D Prediction project on your computer, step by step. Don't worry if you're new to programming or command-line tools—we'll explain everything you need to know.
4
+
5
+ ## What is SHARP?
6
+
7
+ SHARP is a tool that can take a single photograph and create a 3D representation of it, allowing you to view it from different angles. This project includes a user-friendly web interface where you can upload images and download the 3D results.
8
+
9
+ ## Table of Contents
10
+
11
+ 1. [Prerequisites - What You Need](#prerequisites---what-you-need)
12
+ 2. [Step 1: Install Conda](#step-1-install-conda)
13
+ 3. [Step 2: Download the Project](#step-2-download-the-project)
14
+ 4. [Step 3: Set Up the Project](#step-3-set-up-the-project)
15
+ 5. [Step 4: Start the Web Interface](#step-4-start-the-web-interface)
16
+ 6. [Troubleshooting](#troubleshooting)
17
+ 7. [Alternative Setup Methods](#alternative-setup-methods)
18
+
19
+ ---
20
+
21
+ ## Prerequisites - What You Need
22
+
23
+ Before we begin, here's what you'll need:
24
+
25
+ ### Hardware Requirements
26
+ - A computer running **macOS** (for Windows or Linux, see [Alternative Setup Methods](#alternative-setup-methods))
27
+ - At least **8 GB of RAM** (16 GB or more recommended)
28
+ - At least **5 GB of free disk space**
29
+ - **Internet connection** for downloading software and dependencies
30
+
31
+ ### What You Don't Need
32
+ - You don't need to know how to code
33
+ - You don't need prior experience with Python or machine learning
34
+ - You don't need to understand how the AI works (but you can learn if you want!)
35
+
36
+ ---
37
+
38
+ ## Step 1: Install Conda
39
+
40
+ Conda is a package manager that helps organize Python and its libraries. Think of it as an app store for Python tools.
41
+
42
+ ### What is Conda?
43
+
44
+ Conda creates isolated "environments" for different projects, so they don't interfere with each other. We'll use it to install Python and all the tools SHARP needs.
45
+
46
+ ### Download and Install Miniconda
47
+
48
+ 1. **Go to the Miniconda download page:**
49
+ - Open your web browser and visit: https://docs.conda.io/en/latest/miniconda.html
50
+
51
+ 2. **Download the macOS installer:**
52
+ - Look for the **macOS** section
53
+ - Download the **latest Python 3.x** installer for your Mac:
54
+ - If you have an **M1/M2/M3 Mac** (Apple Silicon): Choose the `Apple M1` or `arm64` version
55
+ - If you have an **Intel Mac**: Choose the `Intel x86_64` version
56
+ - The file will be named something like `Miniconda3-latest-MacOSX-arm64.pkg` or `Miniconda3-latest-MacOSX-x86_64.pkg`
57
+
58
+ 3. **Install Miniconda:**
59
+ - Double-click the downloaded `.pkg` file
60
+ - Follow the installation wizard:
61
+ - Click "Continue" through the introduction screens
62
+ - Accept the license agreement
63
+ - Choose "Install for me only" (recommended)
64
+ - Click "Install" and enter your password when prompted
65
+ - When installation completes, click "Close"
66
+
67
+ 4. **Verify the installation:**
68
+ - Open **Terminal** (you can find it in Applications → Utilities → Terminal)
69
+ - Type the following command and press Enter:
70
+ ```bash
71
+ conda --version
72
+ ```
73
+ - You should see something like `conda X.X.X` (the exact version number may vary)
74
+ - **If you get an error** saying "conda: command not found":
75
+ - Close Terminal completely and open it again
76
+ - Try the command again
77
+ - If it still doesn't work, see [Troubleshooting](#troubleshooting)
78
+
79
+ ---
80
+
81
+ ## Step 2: Download the Project
82
+
83
+ Now we need to download the SHARP project files to your computer.
84
+
85
+ ### Option A: Download via GitHub (Easiest for Beginners)
86
+
87
+ 1. **Go to the GitHub repository:**
88
+ - Visit the repository URL where this project is hosted (check the address bar or the project README for the correct URL)
89
+
90
+ 2. **Download the ZIP file:**
91
+ - Click the green **"Code"** button
92
+ - Click **"Download ZIP"**
93
+ - The file will be saved to your Downloads folder
94
+
95
+ 3. **Extract the ZIP file:**
96
+ - Go to your Downloads folder
97
+ - Double-click the `ml-sharp-main.zip` (or similar name) file
98
+ - macOS will automatically extract the folder
99
+
100
+ 4. **Move to a convenient location (optional but recommended):**
101
+ - Create a folder in your Documents called `Projects`
102
+ - Drag the extracted `ml-sharp-main` folder into `Projects`
103
+ - Rename it to just `ml-sharp` to make it simpler
104
+
105
+ ### Option B: Using Git (If You Have It Installed)
106
+
107
+ If you're comfortable with Git or have it installed:
108
+
109
+ ```bash
110
+ cd ~/Documents
111
+ git clone <repository-url>
112
+ cd ml-sharp
113
+ ```
114
+
115
+ (Replace `<repository-url>` with the actual Git URL from the GitHub repository)
116
+
117
+ ---
118
+
119
+ ## Step 3: Set Up the Project
120
+
121
+ Now we'll set up the Python environment and install all the required libraries.
122
+
123
+ ### Using Terminal
124
+
125
+ 1. **Open Terminal** (Applications → Utilities → Terminal)
126
+
127
+ 2. **Navigate to the project folder:**
128
+ - Type `cd` followed by a space
129
+ - Drag the `ml-sharp` folder from Finder onto the Terminal window
130
+ - Press Enter
131
+ - Your command should look something like: `cd /Users/YourName/Documents/Projects/ml-sharp`
132
+
133
+ 3. **Initialize conda in your terminal:**
134
+ ```bash
135
+ conda init bash
136
+ ```
137
+ - Close Terminal and open it again
138
+
139
+ 4. **Create the Python environment:**
140
+ ```bash
141
+ conda create -n sharp python=3.13 -y
142
+ ```
143
+ - This creates a special environment named "sharp" with Python 3.13
144
+ - The process may take a few minutes
145
+ - Wait for it to complete
146
+
147
+ 5. **Activate the environment:**
148
+ ```bash
149
+ conda activate sharp
150
+ ```
151
+ - You should see `(sharp)` appear at the beginning of your command prompt
152
+
153
+ 6. **Install the main project dependencies:**
154
+ ```bash
155
+ pip install -r requirements.txt
156
+ ```
157
+ - This installs all the machine learning libraries SHARP needs
158
+ - **This will take 5-15 minutes** depending on your internet speed
159
+ - You'll see a lot of text scrolling by—this is normal
160
+ - Be patient and let it finish
161
+
162
+ 7. **Install the web interface dependencies:**
163
+ ```bash
164
+ pip install -r src/sharp/web/requirements.txt
165
+ ```
166
+ - This installs the web server components
167
+ - This should be faster, taking about 1-2 minutes
168
+
169
+ 8. **Verify the installation:**
170
+ ```bash
171
+ sharp --help
172
+ ```
173
+ - If successful, you'll see the SHARP help menu
174
+ - This means everything is installed correctly!
175
+
176
+ ---
177
+
178
+ ## Step 4: Start the Web Interface
179
+
180
+ Now for the exciting part—starting the web interface!
181
+
182
+ ### If start.command Works (Try This First)
183
+
184
+ 1. **In Finder, navigate to the ml-sharp folder**
185
+
186
+ 2. **Double-click the `start.command` file**
187
+
188
+ 3. **If macOS blocks it with a security warning:**
189
+ - Right-click (or Control-click) on `start.command`
190
+ - Select **"Open"** from the menu
191
+ - Click **"Open"** in the dialog that appears
192
+ - macOS will remember your choice for this file
193
+
194
+ OR
195
+
196
+ - Go to **System Settings → Privacy & Security**
197
+ - Scroll down to find a message about `start.command` being blocked
198
+ - Click **"Open Anyway"**
199
+ - Right-click on `start.command` again and choose **"Open"**
200
+
201
+ 4. **A Terminal window will open** with the SHARP logo
202
+
203
+ 5. **The script will automatically:**
204
+ - Check your conda installation
205
+ - Create or activate the environment
206
+ - Install any missing dependencies
207
+ - Start the web server
208
+
209
+ 6. **When you see "Starting Sharp Web Interface":**
210
+ - Open your web browser (Safari, Chrome, Firefox, etc.)
211
+ - Go to: **http://localhost:8000**
212
+ - You should see the SHARP web interface!
213
+
214
+ ### If start.command Doesn't Work (Manual Method)
215
+
216
+ If the automatic script doesn't work, don't worry! Here's how to start it manually:
217
+
218
+ 1. **Open Terminal**
219
+
220
+ 2. **Navigate to the project folder:**
221
+ ```bash
222
+ cd /path/to/ml-sharp
223
+ ```
224
+ (Replace with your actual path, or drag the folder onto Terminal)
225
+
226
+ 3. **Activate the conda environment:**
227
+ ```bash
228
+ conda activate sharp
229
+ ```
230
+
231
+ 4. **Start the web server:**
232
+ ```bash
233
+ python src/sharp/web/app.py
234
+ ```
235
+
236
+ 5. **Open your web browser and go to:**
237
+ - **http://localhost:8000**
238
+
239
+ 6. **To stop the server:**
240
+ - Press **Control + C** in the Terminal window
241
+
242
+ ---
243
+
244
+ ## Troubleshooting
245
+
246
+ ### "conda: command not found"
247
+
248
+ **Problem:** Terminal doesn't recognize the `conda` command.
249
+
250
+ **Solutions:**
251
+
252
+ 1. **Initialize conda:**
253
+ ```bash
254
+ ~/miniconda3/bin/conda init bash
255
+ ```
256
+ Then close and reopen Terminal.
257
+
258
+ 2. **Add conda to your PATH manually:**
259
+ ```bash
260
+ echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bash_profile
261
+ source ~/.bash_profile
262
+ ```
263
+
264
+ 3. **If you installed Anaconda instead of Miniconda:**
265
+ ```bash
266
+ echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> ~/.bash_profile
267
+ source ~/.bash_profile
268
+ ```
269
+
270
+ ### "Permission denied" when running start.command
271
+
272
+ **Problem:** The script doesn't have permission to run.
273
+
274
+ **Solution:**
275
+
276
+ 1. Open Terminal
277
+ 2. Navigate to the project folder
278
+ 3. Make the script executable:
279
+ ```bash
280
+ chmod +x start.command
281
+ ```
282
+ 4. Try double-clicking it again
283
+
284
+ ### "Failed to create conda environment"
285
+
286
+ **Problem:** Error creating the Python environment.
287
+
288
+ **Solutions:**
289
+
290
+ 1. **Make sure you have enough disk space** (at least 5 GB free)
291
+
292
+ 2. **Update conda:**
293
+ ```bash
294
+ conda update conda
295
+ ```
296
+
297
+ 3. **Try creating the environment with a different Python version:**
298
+ ```bash
299
+ conda create -n sharp python=3.11 -y
300
+ ```
301
+
302
+ ### Installation is Taking Forever / Stuck
303
+
304
+ **Problem:** `pip install` seems frozen or very slow.
305
+
306
+ **Solutions:**
307
+
308
+ 1. **Be patient:** The first installation can take 10-20 minutes, especially for PyTorch
309
+ 2. **Check your internet connection**
310
+ 3. **If truly stuck (no progress for 30+ minutes):**
311
+ - Press Control + C to cancel
312
+ - Try again:
313
+ ```bash
314
+ pip install -r requirements.txt --no-cache-dir
315
+ ```
316
+
317
+ ### "Port 8000 is already in use"
318
+
319
+ **Problem:** Another application is using port 8000.
320
+
321
+ **Solution:**
322
+
323
+ 1. **Find and stop the process using port 8000:**
324
+ ```bash
325
+ lsof -ti:8000 | xargs kill -9
326
+ ```
327
+
328
+ 2. **Or modify the port in the app.py file:**
329
+ - Open `src/sharp/web/app.py` in a text editor
330
+ - Look for the line near the end: `uvicorn.run(app, host="0.0.0.0", port=8000)`
331
+ (Tip: Search for `port=` to find it quickly)
332
+ - Change `port=8000` to `port=8080` (or another available port number)
333
+ - Save the file and start the server again
334
+ - Then access it at: http://localhost:8080 (or your chosen port)
335
+
336
+ ### The Web Interface Won't Load
337
+
338
+ **Problem:** Browser shows an error when accessing http://localhost:8000
339
+
340
+ **Solutions:**
341
+
342
+ 1. **Make sure the server is actually running** (check Terminal for errors)
343
+ 2. **Try a different browser**
344
+ 3. **Clear your browser cache**
345
+ 4. **Check if you're using the correct URL:** http://localhost:8000 (not https)
346
+ 5. **Look for error messages in the Terminal** and search for them online or see below
347
+
348
+ ### "ModuleNotFoundError: No module named 'sharp'"
349
+
350
+ **Problem:** Python can't find the SHARP module.
351
+
352
+ **Solution:**
353
+
354
+ 1. Make sure you're in the correct directory
355
+ 2. Make sure the conda environment is activated (you should see `(sharp)` in the prompt)
356
+ 3. Try installing again:
357
+ ```bash
358
+ pip install -r requirements.txt
359
+ ```
360
+
361
+ ### Out of Memory Errors
362
+
363
+ **Problem:** Your computer runs out of RAM.
364
+
365
+ **Solutions:**
366
+
367
+ 1. **Close other applications** to free up memory
368
+ 2. **Restart your computer** and try again
369
+ 3. **Consider using the CLI** instead of the web interface for large batches of images
370
+
371
+ ---
372
+
373
+ ## Alternative Setup Methods
374
+
375
+ ### For Windows Users
376
+
377
+ The `start.command` script is macOS-specific, but you can follow these steps on Windows:
378
+
379
+ 1. **Install Miniconda for Windows:**
380
+ - Download from: https://docs.conda.io/en/latest/miniconda.html
381
+ - Choose the Windows installer
382
+
383
+ 2. **Open Anaconda Prompt** (search for it in the Start menu)
384
+
385
+ 3. **Follow steps 3 and 4** from above, using the same commands
386
+
387
+ ### For Linux Users
388
+
389
+ The setup is very similar to macOS:
390
+
391
+ 1. **Install Miniconda for Linux:**
392
+ ```bash
393
+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
394
+ bash Miniconda3-latest-Linux-x86_64.sh
395
+ ```
396
+
397
+ 2. **Follow the macOS instructions** using Terminal
398
+
399
+ ### Using the Command Line Interface (CLI)
400
+
401
+ If you prefer not to use the web interface, you can use SHARP directly from the command line:
402
+
403
+ 1. **Activate the environment:**
404
+ ```bash
405
+ conda activate sharp
406
+ ```
407
+
408
+ 2. **Run a prediction:**
409
+ ```bash
410
+ sharp predict -i /path/to/input/images -o /path/to/output/gaussians
411
+ ```
412
+
413
+ 3. **See all options:**
414
+ ```bash
415
+ sharp --help
416
+ ```
417
+
418
+ ---
419
+
420
+ ## What's Next?
421
+
422
+ Once you have the web interface running:
423
+
424
+ 1. **Upload an image** using the web interface
425
+ 2. **Wait for processing** (usually takes a few seconds per image)
426
+ 3. **Download the 3D Gaussian file** (.ply format)
427
+ 4. **View it** using a 3D Gaussian viewer (the web interface may include a viewer)
428
+
429
+ For more advanced usage, check out the [README.md](README.md) file in the project folder.
430
+
431
+ ---
432
+
433
+ ## Getting Help
434
+
435
+ If you're still stuck after trying these solutions:
436
+
437
+ 1. **Check the project's GitHub Issues page** to see if others have had similar problems
438
+ 2. **Read the main [README.md](README.md)** for additional technical details
439
+ 3. **Create a new GitHub Issue** describing your problem:
440
+ - Include your operating system version
441
+ - Include any error messages you see
442
+ - Describe what you've already tried
443
+
444
+ ---
445
+
446
+ ## Tips for Success
447
+
448
+ - **Be patient:** The first setup takes time, but subsequent runs will be much faster
449
+ - **Read error messages:** They often tell you exactly what's wrong
450
+ - **Google is your friend:** Copy error messages and search for them
451
+ - **Keep your terminal open:** Don't close Terminal while the server is running
452
+ - **Save your work:** The web interface processes images but doesn't permanently store them
453
+
454
+ ---
455
+
456
+ ## Summary of Commands
457
+
458
+ Here's a quick reference of the key commands:
459
+
460
+ ```bash
461
+ # Navigate to project
462
+ cd /path/to/ml-sharp
463
+
464
+ # Activate environment
465
+ conda activate sharp
466
+
467
+ # Start web interface (manual method)
468
+ python src/sharp/web/app.py
469
+
470
+ # Use CLI
471
+ sharp predict -i /path/to/images -o /path/to/output
472
+
473
+ # Deactivate environment when done
474
+ conda deactivate
475
+ ```
476
+
477
+ ---
478
+
479
+ **Congratulations!** 🎉 You now have SHARP set up and running. Enjoy creating 3D representations from your photos!