This is a repository including a sample code for creating a custom touch detection model
for a DIGIT sensor.
See also: PyTouch
It requires pytouch
, digit-interface
, torch
, torchvision
to be installed in your python.
Install with pip install
if not.
- Change the directory name
Dxxxx
to your DIGIT id inDIGIT_train/Dxxxx
- Change
DIGIT_ID
and the path to yours inmake_data.py
- Run
make_data.py
to make your dataset in./Dxxxx/touch
and./Dxxxx/notouch
Each frame will be saved to the specified directory while running.
Make sure to create various touching situations. To achieve this, I changed the touching situation for each set of 200 or 300 frames.
Change DIGIT_ID
in model.py
and run it.
.pth
file will be saved under the ./weight
directory.
Change DIGIT_ID
in realtime_touchdetect.py
and run it.