Senior Design project for CISC498/475 by Casey Rock, Jayson Morgado, Yifan Ni, Ian McCabe, Olu Osinubi, Gavin Morris, and Brennan Gallamoza
- Anaconda
LiveAnnotator.py
Jupyter notebook for realtime microbot detection. Annotates
trackpy.ipynb
is the Jupyter notebook that takes in a video, annotates each frame, then create a new video using the annotated frames. This version will have more verbose output and plots
track.py
Standard python script version of trackpy.ipynb
simple-trackpy.ipynb
Jupyter notebook version that simple takes in a video, annotates each frame, then create a new video using the annotated frames
req.txt
a list of all the python Libraries that need to be downloaded.
/videos
a folder that stores all the input video. If you want to annotated a video add it to this files
/tempframes
a folder the store temporary frames (Our code uses this folder, you do not have to do anything with it)
- Open Anaconda Navigator
- Launch CMD.exe Prompt
- Change the Directroy to the microbots folder.
- For windows type
cd <add path to folder>
- Example
cd C:\Users\casey\Documents\Work\Microbots
- For windows type
- Run
pip install -r req.txt
to download all the required packages - Close CMD.exe Prompt
- Launch Juypter Notebook from Anaconda Navigator
- In Jupyter Notebook, Navigate to the microbots folder
- Open one of the following notebooks:
LiveAnnotator.ipynb
,trackpy.ipynb
, orsimple-trackpy.ipynb
Notes:
pip
may need to be upgraded to correctly installreq.txt
. If installation fails, try upgrading pip by usingpip install --upgrade pip
- If using a virtual environment, use
python -m pip install -r req.txt
instead for Step 4 to use your environment'spip
. Likewise for Note 1
The LiveAnnotator.ipynb
is used to capture a portion of your screen for live annotation of cells. The process works as follows:
1. Run the first code block and all cells in the Trackpy Parameters
section to select parameters for trackpy.locate()
- Running the parameter code blocks will start the program with default parameters. Sometimes adjusting the parameters will improve performance for different videos.
- Details on what each parameter means can be read here.
2. Run the Screen Cropper
code blocks. Now, drag your mouse to select a portion of your screen for the program to record
- Selecting an area is required
- The selected area will be the area that
trackpy.locate()
will apply edge detection to. - If you have already selected an area and want to reselect, simply click on a new area and drag again.
3. Run the Microbot Locator
code blocks. The program will continuously screenshot and annotate the selected area, displaying a stream of annotated images in a new window.
- First, you will need to select whether or not you want the positions of potential microbots recorded
- This only needs to be run once
- The annotated images will be in a separate window from your Jupyter Notebook
- Potential microbots will be circled in blue.
- This will end the
Microbot Locator
code block execution.
5. Run the Export Located Positions to CSV
code block to save a timestamped CSV to the output
folder.
- This code will only save a CSV if "Record Located Microbot Positions?" is set to "Yes", otherwise an error will be printed.
- You do not need to re-run the code blocks for Steps 1-2; shifting the sliders will adjust the already initialized parameters.
- Repeating Step 2 to re-crop the screen is optional; you may simply adjust parameters and skip to Step 3 to use the same selection area.
In the both juypter NoteBook On the first line you want to let the program know the name of the video file you are using. NOTE the video must be in the /videos
folder
################## EDIT THIS TO START ##################
microbot_input_video_name = "Enter Input Video Name Here"
output_Video_name = "Enter Output Video Name Here"
diameter_of_cells = "enter an odd intereger for the diameters of the cells"
proccess_all_frame = True or False # IF True it will prcess all the frames in the video, If False it will process the first 200 frames
########################################################
Once the video are names, run the jupyter notebook and get your annotated video
- Nvidia 1060 Graphics Card
- 8 GB of RAM
- Intel I5 processor
- Operrating System: Windows or Linux
- Nvidia 2060 Graphics Card
- 16 GB of RAM
- Intel I7 processor
- Operrating System: Windows or Linux