copilot-swe-agent[bot] cjgaspari commited on
Commit
595a241
·
1 Parent(s): 7e155ce

Add detailed-setup.md with comprehensive beginner-friendly setup guide

Browse files

Co-authored-by: cjgaspari <3847902+cjgaspari@users.noreply.github.com>

Files changed (1) hide show
  1. detailed-setup.md +475 -0
detailed-setup.md ADDED
@@ -0,0 +1,475 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 24.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: https://github.com/apple/ml-sharp (or the repository URL where this project is hosted)
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 https://github.com/apple/ml-sharp.git
112
+ cd ml-sharp
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Step 3: Set Up the Project
118
+
119
+ Now we'll set up the Python environment and install all the required libraries.
120
+
121
+ ### Using Terminal
122
+
123
+ 1. **Open Terminal** (Applications → Utilities → Terminal)
124
+
125
+ 2. **Navigate to the project folder:**
126
+ - Type `cd` followed by a space
127
+ - Drag the `ml-sharp` folder from Finder onto the Terminal window
128
+ - Press Enter
129
+ - Your command should look something like: `cd /Users/YourName/Documents/Projects/ml-sharp`
130
+
131
+ 3. **Initialize conda in your terminal:**
132
+ ```bash
133
+ conda init bash
134
+ ```
135
+ - Close Terminal and open it again
136
+
137
+ 4. **Create the Python environment:**
138
+ ```bash
139
+ conda create -n sharp python=3.13 -y
140
+ ```
141
+ - This creates a special environment named "sharp" with Python 3.13
142
+ - The process may take a few minutes
143
+ - Wait for it to complete
144
+
145
+ 5. **Activate the environment:**
146
+ ```bash
147
+ conda activate sharp
148
+ ```
149
+ - You should see `(sharp)` appear at the beginning of your command prompt
150
+
151
+ 6. **Install the main project dependencies:**
152
+ ```bash
153
+ pip install -r requirements.txt
154
+ ```
155
+ - This installs all the machine learning libraries SHARP needs
156
+ - **This will take 5-15 minutes** depending on your internet speed
157
+ - You'll see a lot of text scrolling by—this is normal
158
+ - Be patient and let it finish
159
+
160
+ 7. **Install the web interface dependencies:**
161
+ ```bash
162
+ pip install -r src/sharp/web/requirements.txt
163
+ ```
164
+ - This installs the web server components
165
+ - This should be faster, taking about 1-2 minutes
166
+
167
+ 8. **Verify the installation:**
168
+ ```bash
169
+ sharp --help
170
+ ```
171
+ - If successful, you'll see the SHARP help menu
172
+ - This means everything is installed correctly!
173
+
174
+ ---
175
+
176
+ ## Step 4: Start the Web Interface
177
+
178
+ Now for the exciting part—starting the web interface!
179
+
180
+ ### If start.command Works (Try This First)
181
+
182
+ 1. **In Finder, navigate to the ml-sharp folder**
183
+
184
+ 2. **Double-click the `start.command` file**
185
+
186
+ 3. **If macOS blocks it with a security warning:**
187
+ - Right-click (or Control-click) on `start.command`
188
+ - Select **"Open"** from the menu
189
+ - Click **"Open"** in the dialog that appears
190
+ - macOS will remember your choice for this file
191
+
192
+ OR
193
+
194
+ - Go to **System Settings → Privacy & Security**
195
+ - Scroll down to find a message about `start.command` being blocked
196
+ - Click **"Open Anyway"**
197
+ - Right-click on `start.command` again and choose **"Open"**
198
+
199
+ 4. **A Terminal window will open** with the SHARP logo
200
+
201
+ 5. **The script will automatically:**
202
+ - Check your conda installation
203
+ - Create or activate the environment
204
+ - Install any missing dependencies
205
+ - Start the web server
206
+
207
+ 6. **When you see "Starting Sharp Web Interface":**
208
+ - Open your web browser (Safari, Chrome, Firefox, etc.)
209
+ - Go to: **http://localhost:8000**
210
+ - You should see the SHARP web interface!
211
+
212
+ ### If start.command Doesn't Work (Manual Method)
213
+
214
+ If the automatic script doesn't work, don't worry! Here's how to start it manually:
215
+
216
+ 1. **Open Terminal**
217
+
218
+ 2. **Navigate to the project folder:**
219
+ ```bash
220
+ cd /path/to/ml-sharp
221
+ ```
222
+ (Replace with your actual path, or drag the folder onto Terminal)
223
+
224
+ 3. **Activate the conda environment:**
225
+ ```bash
226
+ conda activate sharp
227
+ ```
228
+
229
+ 4. **Start the web server:**
230
+ ```bash
231
+ python src/sharp/web/app.py
232
+ ```
233
+
234
+ 5. **Open your web browser and go to:**
235
+ - **http://localhost:8000**
236
+
237
+ 6. **To stop the server:**
238
+ - Press **Control + C** in the Terminal window
239
+
240
+ ---
241
+
242
+ ## Troubleshooting
243
+
244
+ ### "conda: command not found"
245
+
246
+ **Problem:** Terminal doesn't recognize the `conda` command.
247
+
248
+ **Solutions:**
249
+
250
+ 1. **Initialize conda:**
251
+ ```bash
252
+ ~/miniconda3/bin/conda init bash
253
+ ```
254
+ Then close and reopen Terminal.
255
+
256
+ 2. **Add conda to your PATH manually:**
257
+ ```bash
258
+ echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bash_profile
259
+ source ~/.bash_profile
260
+ ```
261
+
262
+ 3. **If you installed Anaconda instead of Miniconda:**
263
+ ```bash
264
+ echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> ~/.bash_profile
265
+ source ~/.bash_profile
266
+ ```
267
+
268
+ ### "Permission denied" when running start.command
269
+
270
+ **Problem:** The script doesn't have permission to run.
271
+
272
+ **Solution:**
273
+
274
+ 1. Open Terminal
275
+ 2. Navigate to the project folder
276
+ 3. Make the script executable:
277
+ ```bash
278
+ chmod +x start.command
279
+ ```
280
+ 4. Try double-clicking it again
281
+
282
+ ### "Failed to create conda environment"
283
+
284
+ **Problem:** Error creating the Python environment.
285
+
286
+ **Solutions:**
287
+
288
+ 1. **Make sure you have enough disk space** (at least 5 GB free)
289
+
290
+ 2. **Update conda:**
291
+ ```bash
292
+ conda update conda
293
+ ```
294
+
295
+ 3. **Try creating the environment with a different Python version:**
296
+ ```bash
297
+ conda create -n sharp python=3.11 -y
298
+ ```
299
+
300
+ ### Installation is Taking Forever / Stuck
301
+
302
+ **Problem:** `pip install` seems frozen or very slow.
303
+
304
+ **Solutions:**
305
+
306
+ 1. **Be patient:** The first installation can take 10-20 minutes, especially for PyTorch
307
+ 2. **Check your internet connection**
308
+ 3. **If truly stuck (no progress for 30+ minutes):**
309
+ - Press Control + C to cancel
310
+ - Try again:
311
+ ```bash
312
+ pip install -r requirements.txt --no-cache-dir
313
+ ```
314
+
315
+ ### "Port 8000 is already in use"
316
+
317
+ **Problem:** Another application is using port 8000.
318
+
319
+ **Solution:**
320
+
321
+ 1. **Find and stop the process using port 8000:**
322
+ ```bash
323
+ lsof -ti:8000 | xargs kill -9
324
+ ```
325
+
326
+ 2. **Or use a different port:**
327
+ ```bash
328
+ python src/sharp/web/app.py --port 8080
329
+ ```
330
+ Then access it at: http://localhost:8080
331
+
332
+ ### The Web Interface Won't Load
333
+
334
+ **Problem:** Browser shows an error when accessing http://localhost:8000
335
+
336
+ **Solutions:**
337
+
338
+ 1. **Make sure the server is actually running** (check Terminal for errors)
339
+ 2. **Try a different browser**
340
+ 3. **Clear your browser cache**
341
+ 4. **Check if you're using the correct URL:** http://localhost:8000 (not https)
342
+ 5. **Look for error messages in the Terminal** and search for them online or see below
343
+
344
+ ### "ModuleNotFoundError: No module named 'sharp'"
345
+
346
+ **Problem:** Python can't find the SHARP module.
347
+
348
+ **Solution:**
349
+
350
+ 1. Make sure you're in the correct directory
351
+ 2. Make sure the conda environment is activated (you should see `(sharp)` in the prompt)
352
+ 3. Try installing again:
353
+ ```bash
354
+ pip install -r requirements.txt
355
+ ```
356
+
357
+ ### Out of Memory Errors
358
+
359
+ **Problem:** Your computer runs out of RAM.
360
+
361
+ **Solutions:**
362
+
363
+ 1. **Close other applications** to free up memory
364
+ 2. **Restart your computer** and try again
365
+ 3. **Consider using the CLI** instead of the web interface for large batches of images
366
+
367
+ ---
368
+
369
+ ## Alternative Setup Methods
370
+
371
+ ### For Windows Users
372
+
373
+ The `start.command` script is macOS-specific, but you can follow these steps on Windows:
374
+
375
+ 1. **Install Miniconda for Windows:**
376
+ - Download from: https://docs.conda.io/en/latest/miniconda.html
377
+ - Choose the Windows installer
378
+
379
+ 2. **Open Anaconda Prompt** (search for it in the Start menu)
380
+
381
+ 3. **Follow steps 3 and 4** from above, using the same commands
382
+
383
+ ### For Linux Users
384
+
385
+ The setup is very similar to macOS:
386
+
387
+ 1. **Install Miniconda for Linux:**
388
+ ```bash
389
+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
390
+ bash Miniconda3-latest-Linux-x86_64.sh
391
+ ```
392
+
393
+ 2. **Follow the macOS instructions** using Terminal
394
+
395
+ ### Using the Command Line Interface (CLI)
396
+
397
+ If you prefer not to use the web interface, you can use SHARP directly from the command line:
398
+
399
+ 1. **Activate the environment:**
400
+ ```bash
401
+ conda activate sharp
402
+ ```
403
+
404
+ 2. **Run a prediction:**
405
+ ```bash
406
+ sharp predict -i /path/to/input/images -o /path/to/output/gaussians
407
+ ```
408
+
409
+ 3. **See all options:**
410
+ ```bash
411
+ sharp --help
412
+ ```
413
+
414
+ ---
415
+
416
+ ## What's Next?
417
+
418
+ Once you have the web interface running:
419
+
420
+ 1. **Upload an image** using the web interface
421
+ 2. **Wait for processing** (usually takes a few seconds per image)
422
+ 3. **Download the 3D Gaussian file** (.ply format)
423
+ 4. **View it** using a 3D Gaussian viewer (the web interface may include a viewer)
424
+
425
+ For more advanced usage, check out the [README.md](README.md) file in the project folder.
426
+
427
+ ---
428
+
429
+ ## Getting Help
430
+
431
+ If you're still stuck after trying these solutions:
432
+
433
+ 1. **Check the project's GitHub Issues page** to see if others have had similar problems
434
+ 2. **Read the main [README.md](README.md)** for additional technical details
435
+ 3. **Create a new GitHub Issue** describing your problem:
436
+ - Include your operating system version
437
+ - Include any error messages you see
438
+ - Describe what you've already tried
439
+
440
+ ---
441
+
442
+ ## Tips for Success
443
+
444
+ - **Be patient:** The first setup takes time, but subsequent runs will be much faster
445
+ - **Read error messages:** They often tell you exactly what's wrong
446
+ - **Google is your friend:** Copy error messages and search for them
447
+ - **Keep your terminal open:** Don't close Terminal while the server is running
448
+ - **Save your work:** The web interface processes images but doesn't permanently store them
449
+
450
+ ---
451
+
452
+ ## Summary of Commands
453
+
454
+ Here's a quick reference of the key commands:
455
+
456
+ ```bash
457
+ # Navigate to project
458
+ cd /path/to/ml-sharp
459
+
460
+ # Activate environment
461
+ conda activate sharp
462
+
463
+ # Start web interface (manual method)
464
+ python src/sharp/web/app.py
465
+
466
+ # Use CLI
467
+ sharp predict -i /path/to/images -o /path/to/output
468
+
469
+ # Deactivate environment when done
470
+ conda deactivate
471
+ ```
472
+
473
+ ---
474
+
475
+ **Congratulations!** 🎉 You now have SHARP set up and running. Enjoy creating 3D representations from your photos!