Skip to content

AmmarMohammed01/Senior-Design

Repository files navigation

Senior-Design

How to run code?

First time install python libraries (setting up Python Virtual Enivronment):

  1. Open the folder
  2. In terminal run the following for installing libraries on Mac/Linux:
# Mac/Linux
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

or installing libraries on Raspberry Pi:

# Raspberry Pi
sudo apt install python3-picamera2
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Now you can run the program:
python main.py
  1. After finished running program, to close the Python Virtual Environment type in terminal
deactivate

Running code with python libraries already installed:

  1. Open the folder
  2. In terminal run:
source .venv/bin/activate
  1. Now you can run the program:
python main.py
  1. After finished running program, to close the Python Virtual Environment type in terminal
deactivate

Create venv for labelImg

Background

labelImg is the labeling program used the label the golden boards. A caveat we face using it is that it need to run on Python 3.9 for stability. Hence, we need to create a Python 3.9 Virtual Environment (venv)

Mac Instructions

  1. Install Python 3.9
# Install using Homebrew
brew install python@3.9

# To check if installed
which python3.9 # should be /opt/homebrew/bin/python3.9
  1. Create virtual environment w/ Python 3.9
python3.9 -m venv labelimg_env
  1. Install labelImg program
source labelimg_env/bin/activate
pip install labelImg

deactivate

Raspberry Pi 5 Instructions

  1. Create Python Virtual Environment on latest version
python -m venv labelimg_env --system-site-packages
  1. Activate venv
source labelimg_env/bin/activate
  1. Install labelImg program
pip install labelImg # Currently using labelImg-1.8.6
  1. Make adjustments to code to fix "float" error
labelImg.py: line 965
canvas.py: 526, 530, 531
  1. Deactivate after installation and program setup complete
deactivate

File Structure

Main Files in GitHub Repo

.
├── README.md
├── requirements.txt: required python libraries
├── main.py
├── menu.py
├── select_camera.py
├── take_image.py
├── take_image_picam.py
├── launch_image_labeler.py
├── image_comparison.py
└── map_errors.py

Python Program Descriptions

main.py:
- entry point of program

menu.py:
- user interface and options

select_camera.py:
- allow user to select usb or picam

take_image.py:
- capture golden and test board images

take_image_picam.py:
- capture golden and test board images with picamera

launch_image_labeler.py:
- launches labelImg to allow user to label golden board

image_comparison.py:
- compares golden board and test boards images

map_errors.py:
- map regions onto golden board found to be different,
- determine which are likely errors,
- suggest possible error types

Boards would appear in a folder like this

Note: image save type for program is .jpg

.
├── boards
│   ├── arduino
│   │   ├── golden.jpg
│   │   └── roi.json
│   ├── power
│   │   ├── classes.txt
│   │   ├── golden.jpg
│   │   ├── golden.txt
│   │   └── roi.json
│   ├── buck
│   │   ├── classes.txt
│   │   ├── golden.jpg
│   │   ├── golden.txt
│   │   ├── next-test-img-num.json
│   │   ├── roi.json
│   │   ├── test1.jpg
│   │   ├── test2.jpg
│   │   ├── test23.jpg
│   │   ├── test24.jpg
│   │   ├── test25.jpg
│   │   ├── test26.jpg
│   │   ├── test27.jpg
│   │   ├── test28.jpg
│   │   ├── test29.jpg
│   │   └── test30.jpg
│   └── buck-boost
│       ├── golden.jpg
│       ├── next-test-img-num.json
│       ├── roi.json
│       ├── test1.jpg
│       └── test2.jpg

Images currently included in GitHub repository

├── images
│   ├── board_golden.jpg
│   ├── board_golden.txt
│   ├── board_inferno.jpg
│   ├── board_test.jpg
│   ├── classes.txt
│   ├── golden.png
└   └── test1.png

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages