Skip to content

Commit

Permalink
Merge pull request #36 from albanjoseph/dev
Browse files Browse the repository at this point in the history
Signapse v3.0
  • Loading branch information
Saweenbarra authored Apr 18, 2022
2 parents 20c241a + 6047cd7 commit ecd0556
Show file tree
Hide file tree
Showing 60 changed files with 1,105 additions and 1,045 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cmake_build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CMake build and test
name: Build and Test

on:
push:
branches: [ dev ]
branches: [dev]
pull_request:
branches: [ dev ]
branches: [main]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ name: Docs
# events but only for the master branch
on:
push:
branches: [ dev ]
branches: [dev]
pull_request:
branches: [ dev ]

branches: [main]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "doxygen-awesome-css"]
path = doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/google/googletest.git
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
cmake_minimum_required(VERSION 3.0)
project(Signapse)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread")

add_subdirectory(src)
add_subdirectory(test)

enable_testing()
add_test(camera_unit_test camera_test)
#add_test(inference_test inference_test)

set_target_properties(Signapse PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../bin/)
set_property(TARGET Signapse PROPERTY AUTOMOC ON)
#set_target_properties(camera_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
#set_target_properties(inference_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
add_compile_options(-Wall)
add_compile_options(-Wall)

#allows google-tests to be called with ctest (not recommended as output will be less verbose, but in-case the user insists on using ctest)
enable_testing()

add_test(
NAME test
COMMAND ./test/main
)
76 changes: 48 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,94 @@
<!-- PROJECT LOGO -->
<br />
<div align="center">
<h1 align="center">Signapse</h1>
<img src="https://github.com/albanjoseph/Signapse/blob/dev/images/logo.png" alt="logo" width="400" div al ign=center />
</br>
Signapse is here to help you learn and practice sign language on an embedded device you can take anywhere!
</br>
📰 🤩 As featured on:
<a href="https://www.hackster.io/news/signapse-aims-to-turn-a-raspberry-pi-into-an-artificially-intelligent-tutor-for-sign-language-ec1a08d0fc36"> Hackster.io</a> and
<a href="https://channel969.com/signapse-goals-to-flip-a-raspberry-pi-into-an-artificially-clever-tutor-for-signal-language/"> Channel 969</a>!! 🤩 📰
</br>
</br>

![Contributors](https://img.shields.io/github/contributors/albanjoseph/Signapse?style=for-the-badge)
![GitHub Repo stars](https://img.shields.io/github/stars/albanjoseph/Signapse?style=for-the-badge)
![Issues](https://img.shields.io/github/issues-raw/albanjoseph/Signapse?style=for-the-badge)
[![License](https://img.shields.io/github/license/albanjoseph/Signapse?style=for-the-badge)](https://github.com/albanjoseph/Signapse/blob/main/LICENSE)

<br />
<a href="https://github.com/albanjoseph/Signapse/issues">Report Bug</a>
.
<a href="https://github.com/albanjoseph/Signapse/issues">Request Feature</a>
<br />

![Build & Test](https://github.com/albanjoseph/Signapse/actions/workflows/cmake_build.yml/badge.svg)
![Docs](https://github.com/albanjoseph/Signapse/actions/workflows/docs.yml/badge.svg)

<img src="https://github.com/albanjoseph/Signapse/blob/dev/images/logo.png" alt="Signapse Logo" width="400" div al ign=center/>


<h1 align="center">Signapse</h1>

<p align="center">
🎥 Check out our product
<a href="https://www.youtube.com/channel/UCh2uG2pYoSloEU0IFeqDQMA"> Demo Video</a>!!
<br />
📰 🤩 As featured on:
<a href="https://www.hackster.io/news/signapse-aims-to-turn-a-raspberry-pi-into-an-artificially-intelligent-tutor-for-sign-language-ec1a08d0fc36"> Hackster.io</a> and
<a href="https://channel969.com/signapse-goals-to-flip-a-raspberry-pi-into-an-artificially-clever-tutor-for-signal-language/"> Channel 969</a>!! 🤩 📰
📜 Explore our
<a href="https://github.com/albanjoseph/Signapse/wiki"> Wiki</a> to learn more!!
<br />
<br />
<a href="https://github.com/albanjoseph/Signapse/issues">Report Bug</a>
·
<a href="https://github.com/albanjoseph/Signapse/issues">Request Feature</a>
🖇️ Browse the
<a href="https://albanjoseph.github.io/Signapse/html/annotated.html"> Developer Documentation</a>!!
</p>
</p>
</div>
<h3 align="left"></h3>

<h3 align="center"></h3>


# In a Nutshell 🌰

# About Signapse
**Signapse is free open source software that helps everyday people learn sign language for free!​**

**Signapse is an open source software tool that helps everyday people learn sign language for free!​**
Our deep learning enhanced video pipeline is able to detect when users are making the correct input sign, this is used to challenge users to make example signs shown on-screen. At present Signapse is configured to teach the American Sign Language character alphabet; although we hope to add support for more complex and varied hand signs in the future.

For more information check out our <a href="https://github.com/albanjoseph/Signapse/wiki">Wiki</a> where you can find our <a href="https://github.com/albanjoseph/Signapse/wiki/Installation-Guide">installation guide</a>, <a href="https://albanjoseph.github.io/Signapse/html/annotated.html">developer documentation</a> and more. Or to get started quickly simply watch our install guide and demo video below.
For installation information check out our <a href="https://github.com/albanjoseph/Signapse/wiki/Installation-Guide">installation guide</a>; or to get started quickly simply watch our install guide and demo video below. For best results using Signapse, we reccomend keeping your hand witin the green box shown on screen and signing in a well lit environment with a plain background; this helps our AI system easily detect your hand signs. Happy Signapsing! 🥳


https://user-images.githubusercontent.com/33161910/163428318-66b07cc5-5431-41e9-8261-a6f18a6c4551.mp4


# Social Media
Keep up to speed with all of the Signapse news!
# Social Media 🌐
Keep up to date with Signapse! Find us on all our social channels:
</br>

<p align="center">
<a href="https://twitter.com/GU_Signapse" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="signups" height="150" width="100" /></a
<a href="https://www.facebook.com/Signapse-125793226671815" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/facebook.svg" alt="signapse" height="150" width="100" /></a> ·
<!-- <a href="https://instagram.com/insta" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="insta" height="30" width="40" /></a> -->
<a href="https://www.youtube.com/channel/UCh2uG2pYoSloEU0IFeqDQMA" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/youtube.svg" alt="youtube" height="150" width="100" /></a
<a href="https://www.tiktok.com/@gu_signapse" target="blank"><img align="center" src="https://upload.wikimedia.org/wikipedia/en/a/a9/TikTok_logo.svg" alt="tiktok" height="150" width="150" /></a>
<a href="https://www.tiktok.com/@GU_signapse" target="blank"><img align="center" src="https://upload.wikimedia.org/wikipedia/en/a/a9/TikTok_logo.svg" alt="tiktok" height="150" width="150" /></a> ·
<a href="https://www.instagram.com/gu_signapse" target="blank"><img align="center" src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/1024px-Instagram_logo_2016.svg.png" alt="instagram" height="100" width="100" /></a>

</p>

# Technologies
<p align="center"> </a> <a href="https://isocpp.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/cplusplus/cplusplus-original.svg" alt="cplusplus" width="100" height="150"/> </a> </a>
<a href="https://www.raspberrypi.org/" > <img src="https://elinux.org/images/c/cb/Raspberry_Pi_Logo.svg" alt="rpi" width="84" height="105" /> </a>
<a href="https://www.linux.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/linux/linux-original.svg" alt="linux" width="100" height="150"/> </a>
# Technologies ⚙️
Signapse is built using:
- [C++ Programming Language](https://www.cplusplus.com/)
- [Debian/Ubuntu Linux](https://www.linux.org/)
- [Raspberry Pi](https://www.raspberrypi.org)
- [Tensorflow](https://www.tensorflow.org/)
- [OpenCV](https://opencv.org/)
- [Google Test](https://github.com/google/googletest)
- [Doxygen](https://www.doxygen.nl/index.html)
- [Qt](https://www.qt.io/)

<!-- LICENSE -->

# License
# License 📰

Distributed under the GPL-3.0 License. See [`LICENSE`](https://github.com/albanjoseph/Signapse/blob/main/LICENSE) for more information.


# Contact Us
# Contact Us 📞
- 🔭This project is being completed by a team of students at the University of Glasgow :

* [Adam Frew](https://github.com/Saweenbarra)
* [Alban Joseph](https://github.com/albanjoseph)
* [Lewis Russell](https://github.com/charger4241)
* [Ross Gardiner](https://github.com/rossGardiner)
- 📫 Contact us: **[email protected]**
- 📫 Email: **[email protected]**
2 changes: 1 addition & 1 deletion dconfig
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE =
EXCLUDE = src/MultiThreadedSchedulableLink.cpp src/MultiThreadedSchedulableLink.h src/BatchCNNProcessor.cpp src/BatchCNNProcessor.h src/NThreadedCNNProcessor.cpp src/NThreadedCNNProcessor.h src/QtGeneratedGui.h

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
Binary file added images/classSceneCallback__inherit__graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pipeline.pdf
Binary file not shown.
Binary file added images/pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pipeline2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install cmake gcc qtbase5-dev qtdeclarative5-dev qt5-default libgtest-dev -y

CV_VERSION="69357b1e88680658a07cffde7678a4d697469f03"

## Download OpenCV code
printf "Downloading OpenCV ..."
if [ ! -d "opencv_src" ]; then
Expand All @@ -13,17 +11,17 @@ if [ ! -d "opencv_src" ]; then
else
printf " skipped\n"
fi

## Build OpenCV
printf "Building OpenCV ..."
if [ ! -d "opencv_build" ]; then
printf "\n"
mkdir -p opencv_build
cd opencv_build
cmake -D WITH_QT=ON -DCMAKE_BUILD_TYPE=Release ../opencv_src || exit 1
make || exit 1
#install with only the nessessary packages - reduces build time
cmake -DBUILD_LIST=dnn,improc,videoio, -DCMAKE_BUILD_TYPE=Release ../opencv_src || exit 1
#set make jobs to 4 - reduces build time
make -j4 || exit 1
cd ..
else
printf " skipped\n"
fi


28 changes: 25 additions & 3 deletions src/BlockingQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// Blocking queue implementation, currently only blocks when Get is attempted while there are no elements inside the queue. In the future and max size could be defined and blocking could be added when the queue is full
//
#include "BlockingQueue.h"

/*!
* Pop method, uses mutex lock to sleep the current thread until data are available on the queue. This may be used to synchonise and schedule threads.
* @tparam T
* @return Element on deque back
*/
template <typename T>
T BlockingQueue<T>::Pop() {
std::unique_lock<std::mutex> lock(mutex);
Expand All @@ -11,16 +15,34 @@ T BlockingQueue<T>::Pop() {
internalQueue.pop_back();
return ret;
}

/*!
*
* @tparam T
* @return true if internal queue empty, false otherwise
*/
template <typename T>
bool BlockingQueue<T>::IsEmpty(){
return internalQueue.empty();
}

/*!
* Gets the current length of elements in the queue.
* @tparam T
* @return size of internal deque
*/
template <typename T>
int BlockingQueue<T>::Size(){
return internalQueue.size();
}

/*!
* adds element to the queue.
* @tparam T
* @param toPush
*/
template <typename T>
void BlockingQueue<T>::Push(T toPush) {
{
std::unique_lock <std::mutex> lock(mutex);
internalQueue.push_front(toPush);
}
condition.notify_all();
Expand Down
13 changes: 7 additions & 6 deletions src/BlockingQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
#include <deque>
#include <mutex>
#include <condition_variable>
#include "scene.h"
#include "Scene.h"


template <typename T>
//! BlockingQueue Class
/*!
*/

/*!
* Class to wrap around std::deque and block thread execution when no data is available at the output.
* @tparam T Type of elements in the queue
*/
class BlockingQueue {
public:
//! Public member function
/*!
*/
void Push(T toPush);
T Pop();
bool IsEmpty();

int Size();
private:
std::deque<T> internalQueue;
std::mutex mutex;
Expand Down
32 changes: 19 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
#find and include opencv
set(OpenCV_DIR "../opencv_build")
message("Linking OpenCV build at directory: " ${OpenCV_DIR}$ )
find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
message("Including OpenCV build at directory: " ${OpenCV_INCLUDE_DIRS})

#find Qt5Widgets
find_package(Qt5Widgets REQUIRED)

add_executable(Signapse main.cpp reel.cpp camera.cpp taskmaster.cpp CNNProcessor.cpp BlockingQueue.cpp Gui.cpp ProgressBar.cpp)
target_link_libraries(Signapse ${OpenCV_LIBS} Qt5::Widgets)
#find Threads, prefer pthread
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)

add_library(reel reel.cpp reel.h)
target_link_libraries(reel ${OpenCV_LIBS})
#compile and link main signapse executable
add_executable(Signapse main.cpp Camera.cpp CNNProcessor.cpp PipelineLink.cpp LinkSplitter.cpp SchedulableLink.cpp PreProcessor.cpp BlockingQueue.cpp Gui.cpp ProgressBar.cpp )
target_link_libraries(Signapse ${OpenCV_LIBS} Qt5::Widgets Threads::Threads)

add_library(camera camera.cpp camera.h)
target_link_libraries(camera ${OpenCV_LIBS} reel)
#build objects for testing as static libs
add_library(Camera Camera.cpp Camera.h)
target_link_libraries(Camera ${OpenCV_LIBS} Threads::Threads)

add_library(CNNProcessor CNNProcessor.cpp CNNProcessor.h)
target_link_libraries(CNNProcessor ${OpenCV_LIBS})
add_library(CNNProcessor CNNProcessor.cpp CNNProcessor.h SchedulableLink.cpp PipelineLink.cpp)
target_link_libraries(CNNProcessor ${OpenCV_LIBS} Threads::Threads)

add_library(FrameEditor FrameEditor.cpp FrameEditor.h)
target_link_libraries(FrameEditor ${OpenCV_LIBS})
add_library(PreProcessor PreProcessor.cpp PreProcessor.h)
target_link_libraries(PreProcessor ${OpenCV_LIBS})

add_library(BlockingQueue BlockingQueue.cpp BlockingQueue.h)

add_library(Gui Gui.cpp Gui.h)
target_link_libraries(Gui ${OpenCV_LIBS} Qt5::Widgets)
target_link_libraries(Gui ${OpenCV_LIBS} Qt5::Widgets Threads::Threads)
Loading

0 comments on commit ecd0556

Please sign in to comment.