Sunday, November 13, 2022

RC Car Explorations

 Well thanks to an insatiable curiosity and my friend Evan, I've purchased Element RC Enduro Bushido Trail Truck 4X4 RTR 1/10 Rock Crawler (White) w/2.4GHz Radio. I'm going to look into what it might take to add some autonomy features to it, probably following/learning from what they've done at https://www.donkeycar.com/ I happen to already have an Jetson Nano to play with, a couple arduinos, and some motor drivers along with some nema 17 motors (which i've been thinking of using for either autonomous crawler vehicle, and/or 3d printed robot arms).


Today I learned:

- EC3 connectors (which are those blue ones commonly used for RC Planes), and dean's connectors (usually used for RC cars.) I had to buy an adaptor because the smart charger I had for my RC planes uses these EC3 connectors.

- I should be able to 3d print a mount for the computer for the "body" which is the cover that goes over the RC vehicle. 

- My batteries are 2C and 5200 mah @ 7.2Volts LiPo, so theoretically I can charge

but my battery charger can only output 5A. (which is fine, but just slower speed)

- I wanted to know what voltage would indicate my batteries are fully charged so the relationship is: 

so my 2s battery when fully charged would provide 8.4 volts.



Now I'm going to go buy some more of the donkey car parts so I can get some automation going.

Friday, January 21, 2022

Yolact

Here's a quick rundown of how I used the yolact (a well written semantic segmentation network) to train a detector and classifier for my face.

 

Labeling Data with LabelMe


Running my custom detector


LabelMe Setup (in anaconda prompt)

conda create --name=labelme python=3.6

conda activate labelme

pip install labelme

git clone https://github.com/wkentaro/labelme

pip install pycocotools

LabelMe Usage

labelme

(label your images into separate folders: train, validate, test)

(create a label.txt each folder with classes)


Convert Labels to COCO format (in anaconda prompt)

.\labelme2coco.py <path to folder with pics>\nick_train\ <output folder>\nick_train_coco --labels <path to class list>\label.txt

(repeat for each folder)

(copy output folders into yolact/data/)


Configure dataset in yolact

configure yoloact/data/config.py with your dataset according to either of these:

https://github.com/dbolya/yolact

https://www.immersivelimit.com/tutorials/train-yolact-with-a-custom-coco-dataset


Train custom network

./train.py --config=yolact_resnet50_nick_dataset_config

If you get a cpu missing error, see the post below about fixing CPU/GPU error then try again.


Run the custom network 

(webcam)

python eval.py --trained_model=./weights/yolact_plus_resnet50_nick_dataset_535_1070_interrupt.pth --config=yolact_resnet50_nick_dataset_config --score_threshold=0.15 --top_k=15 --video_multiframe=4 --video=0

(files)

python eval.py --trained_model=./weights/yolact_plus_resnet50_nick_dataset_535_1070_interrupt.pth --config=yolact_resnet50_nick_dataset_config --score_threshold=0.3 --top_k=15 --images=./data/nick_test:output_images


-----------------------------------------

References:

https://github.com/dbolya/yolact

https://github.com/wkentaro/labelme


The Papers

https://arxiv.org/pdf/1904.02689.pdf

https://arxiv.org/pdf/1912.06218.pdf


For Making Datasets

https://github.com/dbolya/yolact/issues/70#issuecomment-504283008


Tutorial for custom training

https://www.immersivelimit.com/tutorials/train-yolact-with-a-custom-coco-dataset

https://daddynkidsmakers.blogspot.com/2020/05/yolact-based-object-segmentation-with.html


Fixing training CPU/GPU error

https://github.com/dbolya/yolact/issues/664#issuecomment-878241658