Skip to content
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
90 changes: 27 additions & 63 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,44 @@
# CV Workshop

### Installation for Windows
```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# 1. Install Python 3.12 (specifically stable for CV/ML libraries)
Write-Host "Searching for Python 3.12..." -ForegroundColor Cyan
winget install --id Python.Python.3.12 --source winget --exact --accept-package-agreements --accept-source-agreements
1. Go to [Windows Setup](setup/ultralytics-win.ps1)
2. Copy the script.
3. Paste in PowerShell/Windows Terminal of your laptop/PC.
4. Click ```Enter``` when prompted.
5. Follow the installation.

# 2. Refresh the session so we can use 'python' immediately
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
### Installation for MacOS/Linux
1. Go to [MacOS Setup](setup/setup/ultralytics-mac.sh) / [Linux Setup](setup/ultralytics-linux.sh)
2. Copy the script.
3. Paste in the Terminal of your Mac.
4. Follow the installation.

# 3. Check if Python is now accessible
if (Get-Command python -ErrorAction SilentlyContinue) {
Write-Host "Python installed successfully!" -ForegroundColor Green
Write-Host "Checking for Git..." -ForegroundColor Cyan
### VS Code Setup
1. Open VS Code. Go to <img width="180" height="31" alt="image" src="https://github.com/user-attachments/assets/b05b2a32-ea3a-43b0-bebb-eae9093dc0f6" />
2. Browse to the cloned directory (Path shown at the end of installation)
3. Open the folder named 'CV_Workshop'
4. Open ```test.py``` and run it.

# Check if Git is already installed to avoid redundant work
if (Get-Command git -ErrorAction SilentlyContinue) {
Write-Host "Git is already installed. Skipping..." -ForegroundColor Green
} else {
Write-Host "Git not found. Starting installation via Windows Package Manager..." -ForegroundColor Yellow

# --accept-package-agreements: Bypasses the license prompt
# --accept-source-agreements: Bypasses the winget source prompt
# --silent: Ensures no UI popups interrupt the workshop
winget install --id Git.Git --source winget --exact --accept-package-agreements --accept-source-agreements --silent

if ($LASTEXITCODE -eq 0) {
Write-Host "Git installed successfully!" -ForegroundColor Green

# Refresh Path so the 'git' command works in the current session
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
} else {
Write-Host "Installation failed. Please ensure you are running PowerShell as Administrator." -ForegroundColor Red
}
}

git clone https://github.com/mittechteam/CV_Workshop.git
cd CV_Workshop
### Debug VS Code library issue
1. Go to the bottom left corner.
2. Click - <img width="333" height="112" alt="venv-issue-vscode" src="https://github.com/user-attachments/assets/02cb0c73-4aad-4f4a-9f9e-8bc3eae13117" />
3. Make sure it is set to -
- ```.\.venv\Scripts\python``` for Windows.
- ```venv\bin\python3``` for MacOS/Linux.

# 5. Create and Activate Virtual Environment
Write-Host "Setting up Virtual Environment..." -ForegroundColor Cyan
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# 6. Install Ultralytics and dependencies
Write-Host "Installing Ultralytics (YOLO)..." -ForegroundColor Yellow
python -m pip install --upgrade pip
pip install -U ultralytics
python test.py
} else {
Write-Host "Installation failed. You may need to restart PowerShell or install Python manually from Python.org." -ForegroundColor Red
}
```


## To run from terminal -
### Activate Virtual Environment
1. Powershell (Windows):
1. PowerShell (Windows):
```
.\.venv\Scripts\Activate.ps1
```
2. Linux/MacOS:
```
source .venv/bin/activate
```
```

### Steps to Debug python path issue
1. **Open Environment Variables**
Expand All @@ -71,16 +47,4 @@ source .venv/bin/activate
- In the System Properties window, click the Environment Variables button.
2. **Check path**
- Under the User variables section, find and select the ``Path`` variable, then click Edit.
- Select python path and press ``move up`` till it gets at the top.

### Install ultralytics
```
pip install ultralytics
```

### Colour picker
- [here](https://colorpicker.me/#b0b0b2)

## MIT TECH TEAM WEBSITE
- [here](https://www.robocon.in/)

- Select python path and press ``move up`` till it gets at the top.