Scouter: A human face detector which displays your Github contribution statistics.
- Fetch data with Github API
- Github user data
- Github user avatar
- Parse Github contribution HTML to get user contribution statistics
- Convert avatar to identity with Face Recognition API. Encoding avatar identity with userId.
- Track face and crop face image from camera streaming with OpenCV
- Send face image to Flask API server
- Convert unknown face image to identity.
- Get userId and contribution statistics with identity.
- Send user contribution to App and display.
- Have a local running mongoDB using docker
make db
- (Optional) Import dump user data
make migrate
# Check user data in mongodb
docker exec -it mongo mongo scouter --eval "printjson(db.users.findOne())"
docker exec -it mongo mongo scouter --eval "printjson(db.users.count())"
Skip 'Fetching data with Github API' if using dump data
- Github -> User -> settings -> Developer settings -> Personal access tokens
- Keep your token safe.
-
Install go
-
Fetch user data with Github Search API
GITHUB_ACCESS_TOKEN=
go build ./cmd/user_fetcher && ./user_fetcher -token ${GITHUB_ACCESS_TOKEN}
- Fetch user detail information like follwers and repos with Github User API
go build ./cmd/user_detail_fetcher && ./user_detail_fetcher -token ${GITHUB_ACCESS_TOKEN}
- Fetch users' avatar with user.url from data in mongodb
go build ./cmd/avatar_downloader && ./avatar_downloader
- Fetch users' contribution statics by parsing html response of user.url from data in mongodb
go build ./cmd/contribution_fetcher && ./contribution_fetcher
- Make sure user avatar are good to go
ls data/avatars
- Prepare a python virtual env
python3 -m venv .venv
source ./.venv/bin/activate
- Install python dependency
pip3 install dlib flask face_recognition pymongo bson
- Try some face recognition API
face_recognition --show-distance true --tolerance 0.54 ./pictures_of_people_i_know/ ./unknown_pictures/
- Prepare face identity file with encoding generator
# Filter data/avatars image. Save images with human faces to data/human_face.
# Generate face_recognition/encodings and face_recognition/index with data/human_face
python ./face_recognition/encoding_file_generator.py
- Run apiserver to serve face recognition API
python ./face_recognition/apiserver.py
- Send imageBytes to api server
PostRequest("http://"+apiserverip+":5000/face_detection", imageBytes)
-
Download latest Unity with iOS Build tools
-
Create a new project
-
Download and import a free face tracker example from unity asset store Face Tracker Example
-
Download and import another priced asset is required: OpenCV for Unity NOTE: This is a priced asset.
-
Copy unity scenes and scripts
cp -r unity/Assets/Scouter/* <unity-workspace>/<your-project>/Assets/FaceTrackerExample
- Open Unity and setup. File -> Build Settings -> Player Settings
Mac App Store Options -> Bundle Identifier: com.chechiachang.scouter
Configuration -> Scriptin Runtime Version: .NET 4.x Equivalent -> restart
- Open Scenes/WebCamTextureFaceTrackerExample
Inspector -> Web Cam Texture Face Tracker Example -> Apiserverip:
- 127.0.0.1 on your localhost mac
- 172.20.10.3 with personal hotspot of Iphone
Run
- Open unity build for iphone project with xcode. Open another project.
- Xcode developer account:
- Xcode - Preferences - Accounts: Add and login your 'apple developer ID'.
- The team of your developer account will show up.
- In my case, A personal team show up with my username as team name.
- Signing:
- Click my-project. The project configure page will show up.
- General - Identity: Change your display name and Bundle Identifier. Any reasonable identifier other than the example identifier will work.
- General - Signing: Check 'Automatically manage signing'.
- Choose your team. A signing certificates will show up.
- If you stuck here, check your bundle identifier.
- Attach your device (your iphone). Unlock your iphone.
- Click 'Build and Run Current Schema'.
- Github API crawler
- Add an API to search user in Taiwan
- Order by joined asc
- Implement a API call with narrowed search condition
- Add an API to fetch user Data
- Get user with userUrl
- order by most follower
- order by most commit. Might need query by username.
- Save user data to mongodb
- username
- avatar
- # of follower
- # of contributions
- Add an API to search user in Taiwan
- Google Search API Face downloader
- Search Avatar with Github username and login
- Google Custom Search API Google Custom Search API
- Face Recognizer
- Face detector
- Generate face encoding and save to Python Pickle file
- Face Recognition Face recognition
- Face detector
- Front-End
- Unity ios app
- API portal
- AR GUI
- Readme