Skip to content

Here stores the codes for research project "Real-Time Convolutional Neural Network-Based Star Detection and Centroiding Method for CubeSat Star Tracker"

Notifications You must be signed in to change notification settings

HongruiZhao/CNNStarDetectCentroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Convolutional Neural Network-Based Star Detection and Centroiding Method for CubeSat Star Tracker

Hongrui Zhao, Michael Lembeck, Adrian Zhuang, Riya Shah, Jesse Wei

     

Setup

First clone the repository

git clone -b development --single-branch https://github.com/HongruiZhao/CNNStarDetectCentroid.git
cd  CNNStarDetectCentroid

Create a conda environment

conda create -n CNNStarDetectCentroid python=3.8
conda activate CNNStarDetectCentroid

Install pytroch with cuda 11.8

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu118

Install other python packages

pip install matplotlib opencv-python scipy pandas tqdm thop gdown

Finally install tensorboard

conda install tensorboard

Nightsky videos

Download our nightsky test video video_Test3.npy recorded with MT9V022 camera

cd hardware_experiment
mkdir saved_results
cd saved_results
gdown --id 1iFCgP53cGZ1if_lJWfbFz7qWKfQnFRJI
cd ..
  • For more non straylight videos, change id to 1GxRY8bjWUDtSBRQuXRqOdqgUGGVbaXm_ or 1d-5s3l1tqr7-LotzIVaYLj3xz3nSUDY-.
  • 1MKtcN-BGVzJCeHnqVky1nkWy64VJiUin for stralight video.
  • 1AwpNSWLYxyYel-cjeH1Zpg2WJRxKS88D for moonlight video. It does not work very well since the camera was moving around during the recording.

Data generation

cd data_generation
gdown --id 1_uvcg0AcxmWhJoxbO5dH1Y51mUlNPW3R
unzip dark_frames_straylight.zip 

This will download two sets of dark frames: dark_frames_Oct19 which only contains noise frames without straylight, and dark_frames_straylight.

python main_generate_data.py --data 1 --parent_dir "./training_data" --dark_frames_dir "./dark_frames_straylight"

This will generate and save 2500 training images, 500 evaluation images, and 500 test images into training_data folder using the dark frames from dark_frames_straylight.

Training

cd training
python training_stepLR.py --trial 1 

Run

Run with video_Test3.npy

python main_detection_centroiding.py --mode NN --input video --video_file video_Test3.npy
  • By default it will run our trained model hardware_experiment/saved_models/MobileUNet_B10_50.pt.
  • If you want to run ELUnet, go into hardware_experiment/main_detection_centroiding.py, function main_video(), and comment out MobileUNet and uncomment ELUNet.
  • Changing --mode to baseline will run the baseline methods defined in function run_baseline().

Evaluation

Usehardware_experiment/evaluation.ipynb to get attitude determination accuracy.

About

Here stores the codes for research project "Real-Time Convolutional Neural Network-Based Star Detection and Centroiding Method for CubeSat Star Tracker"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published