-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf0d367
commit ac95654
Showing
10 changed files
with
465 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import sys | ||
from PyQt5.QtWidgets import QApplication | ||
from pages.home_page import HomePage | ||
|
||
if __name__ == "__main__": | ||
app = QApplication(sys.argv) | ||
home_page = HomePage() | ||
home_page.show() | ||
sys.exit(app.exec_()) |
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QHBoxLayout, QFrame | ||
from PyQt5.QtGui import QPixmap | ||
|
||
class HandGestureRecognitionPage(QWidget): | ||
def __init__(self): | ||
super().__init__() | ||
self.setWindowTitle("Hand Gesture Recognition") | ||
self.setGeometry(100, 100, 800, 600) | ||
|
||
main_layout = QHBoxLayout() | ||
left_layout = QVBoxLayout() | ||
self.left_hand_label = QLabel("Left Hand Gesture:") | ||
self.left_hand_emoji = QLabel() | ||
left_layout.addWidget(self.left_hand_label) | ||
left_layout.addWidget(self.left_hand_emoji) | ||
|
||
self.stream_frame = QFrame() | ||
self.stream_frame.setStyleSheet("background-color: black;") | ||
self.stream_frame.setFixedSize(400, 600) | ||
|
||
right_layout = QVBoxLayout() | ||
self.right_hand_label = QLabel("Right Hand Gesture:") | ||
self.right_hand_emoji = QLabel() | ||
right_layout.addWidget(self.right_hand_label) | ||
right_layout.addWidget(self.right_hand_emoji) | ||
|
||
main_layout.addLayout(left_layout) | ||
main_layout.addWidget(self.stream_frame) | ||
main_layout.addLayout(right_layout) | ||
|
||
self.setLayout(main_layout) | ||
|
||
def update_emojis(self, left_emoji_path, right_emoji_path): | ||
self.left_hand_emoji.setPixmap(QPixmap(left_emoji_path)) | ||
self.right_hand_emoji.setPixmap(QPixmap(right_emoji_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
from PyQt5.QtWidgets import QLabel, QVBoxLayout, QPushButton, QWidget, QHBoxLayout | ||
from PyQt5.QtGui import QPixmap, QPainter | ||
from PyQt5.QtSvg import QSvgRenderer | ||
from PyQt5.QtCore import Qt | ||
from .hand_gesture_page import HandGestureRecognitionPage | ||
|
||
class HomePage(QWidget): | ||
def __init__(self): | ||
super().__init__() | ||
self.setWindowTitle("SensorFusion: Home") | ||
self.setGeometry(100, 100, 800, 600) | ||
|
||
# Main layout | ||
main_layout = QHBoxLayout() | ||
|
||
# Left layout for logo and introduction | ||
left_layout = QVBoxLayout() | ||
|
||
# Logo using QSvgRenderer | ||
self.logo_label = QLabel(self) | ||
self.svg_renderer = QSvgRenderer("../Datasets/UGLogo.svg") # Use SVG file path | ||
|
||
# Create a QPixmap from the SVG renderer | ||
desired_width = 150 | ||
desired_height = int(desired_width / (self.svg_renderer.defaultSize().width() / self.svg_renderer.defaultSize().height())) | ||
|
||
# Set the logo pixmap by rendering the SVG | ||
pixmap = QPixmap(int((self.svg_renderer.defaultSize().width())/10) , int((self.svg_renderer.defaultSize().height())/10)) | ||
pixmap.fill(Qt.transparent) # Fill with transparent background | ||
|
||
# Create a painter to render the SVG onto the pixmap | ||
painter = QPainter(pixmap) | ||
self.svg_renderer.render(painter) | ||
painter.end() | ||
|
||
self.logo_label.setPixmap(pixmap) | ||
self.logo_label.setScaledContents(True) # Allow scaling | ||
left_layout.addWidget(self.logo_label) | ||
|
||
# Introduction label | ||
welcome_label = QLabel("Welcome to SensorFusion", self) | ||
welcome_label.setStyleSheet("font-size: 20px; font-weight: bold;") | ||
left_layout.addWidget(welcome_label) | ||
|
||
# Add left layout to the main layout | ||
main_layout.addLayout(left_layout) | ||
|
||
# Layout for demo buttons | ||
button_layout = QVBoxLayout() | ||
demo_buttons = [ | ||
("Hand Gesture Recognition", self.open_hand_gesture_page), | ||
("Facial Expression Recognition", self.open_facial_expression_page) | ||
] | ||
|
||
for text, handler in demo_buttons: | ||
button = QPushButton(text, self) | ||
button.clicked.connect(handler) | ||
button_layout.addWidget(button) | ||
|
||
# Add the button layout to the main layout | ||
main_layout.addLayout(button_layout) | ||
|
||
# Set the main layout | ||
self.setLayout(main_layout) | ||
|
||
def open_hand_gesture_page(self): | ||
self.hand_gesture_page = HandGestureRecognitionPage() | ||
self.hand_gesture_page.show() | ||
|
||
def open_facial_expression_page(self): | ||
print("Facial Expression Recognition demo selected") # Placeholder for future implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
QLabel { | ||
font-size: 24px; | ||
font-weight: bold; | ||
} | ||
QPushButton { | ||
background-color: #4CAF50; | ||
color: white; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 5px; | ||
font-size: 16px; | ||
} |
Empty file.
Empty file.
Oops, something went wrong.