From f95e8b769275da2e15fcaabc69f3e7c994133b69 Mon Sep 17 00:00:00 2001 From: Kasia Zaleska <62251989+kzaleskaa@users.noreply.github.com> Date: Sat, 20 Jan 2024 21:42:00 +0100 Subject: [PATCH] Fix requirements (#6) * updare readme * add components --- GUI/DetectionWindow.py | 2 +- GUI/MainWindow.py | 2 +- README.md | 27 +++++++++++-------- .../GestureRecognition.py | 2 +- {spotify => components}/Spotify.py | 3 --- {spotify => components}/__init__.py | 0 pyui/StartWindow.py | 3 --- 7 files changed, 19 insertions(+), 20 deletions(-) rename GestureRecognitionThread.py => components/GestureRecognition.py (99%) rename {spotify => components}/Spotify.py (99%) rename {spotify => components}/__init__.py (100%) diff --git a/GUI/DetectionWindow.py b/GUI/DetectionWindow.py index 1759a81..e434376 100644 --- a/GUI/DetectionWindow.py +++ b/GUI/DetectionWindow.py @@ -2,7 +2,7 @@ from PyQt5.QtGui import QIcon, QImage, QPixmap from PyQt5.QtWidgets import QDialog -from GestureRecognitionThread import GestureRecognitionThread +from components.GestureRecognition import GestureRecognitionThread from pyui.DetectionWindow import Ui_DetectionWindow diff --git a/GUI/MainWindow.py b/GUI/MainWindow.py index 853f2c3..d31b883 100644 --- a/GUI/MainWindow.py +++ b/GUI/MainWindow.py @@ -4,7 +4,7 @@ from GUI.DetectionWindow import DetectionWindow from pyui.StartWindow import Ui_MainWindow -from spotify.Spotify import SpotifyAPI +from components.Spotify import SpotifyAPI class MainWindow(QMainWindow, Ui_MainWindow): diff --git a/README.md b/README.md index 868d862..2edb447 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ Spotify Gesture Controller logo - - ## 📝 Description + Spotify Gesture Controller is a project realised during "Programming in functional languages" course. The main goal was create the app, which can: - play/pause current track @@ -16,39 +15,45 @@ Spotify Gesture Controller is a project realised during "Programming in function using hand gestures. To do this, **Python 3.9** was used with **OpenCV** and **MediaPipe** libraries. **Tensorflow** model was trained on custom dataset, which was created by myself. ## 🏃‍ How to install and run it? + **Remember: to use this app you need to have premium version of Spotify.** 1. Download repository - ``` + ``` git clone https://github.com/kzaleskaa/hand-gesture-recognition.git cd hand-gesture-recognition ``` -2. Create a new project at [Spotify Dashboard](https://developer.spotify.com/dashboard/) and edit settings - add ```http://localhost:8888/spotify-api/callback/``` in Redirect URLs. -3. Create your conda environment and install all requirements +2. Create a new project at [Spotify Dashboard](https://developer.spotify.com/dashboard/) and edit settings - add `http://localhost:8888/spotify-api/callback/` in Redirect URLs. +3. Create your environment and activate it ```bash $ python -m venv venv ``` -4. In root project directory, create .env file with following content (from your Spotify Dashboard): +4. Install requirements + ```bash + $ pip install -r .\requirements.txt + ``` +5. In root project directory, create .env file with following content (from your Spotify Dashboard): ``` CLIENT_ID= CLIENT_SECRET= ``` -5. Start app +6. Start app ``` python main.py ``` -6. Open your spotify app, start play music and use this app to control it +7. Open your spotify app, start play music and use this app to control it ## ✋ Gestures ![ezgif com-gif-maker (9)](https://user-images.githubusercontent.com/62251989/150003931-1bb5ec49-8f3a-4c2e-8ed4-a12f89ddafe2.gif) - ## 🎶 Spotify API ->Based on simple REST principles, the Spotify Web API endpoints return JSON metadata about music artists, albums, and tracks, directly from the Spotify Data Catalogue. + +> Based on simple REST principles, the Spotify Web API endpoints return JSON metadata about music artists, albums, and tracks, directly from the Spotify Data Catalogue. If no action on Spotify is made, please open your app and start play music manually. Then, you can use this app to control it. ## 🖊 Credits + - Heart photo created by nakaridore - [Freepik](www.freepik.com) -- Icons - [Flaticon](Flaticon.com) \ No newline at end of file +- Icons - [Flaticon](Flaticon.com) diff --git a/GestureRecognitionThread.py b/components/GestureRecognition.py similarity index 99% rename from GestureRecognitionThread.py rename to components/GestureRecognition.py index 60aad2b..cb6c446 100644 --- a/GestureRecognitionThread.py +++ b/components/GestureRecognition.py @@ -9,7 +9,7 @@ from PyQt5.QtGui import QImage from constants import ACTIONS, THRESHOLD -from spotify.Spotify import SpotifyAPI +from components.Spotify import SpotifyAPI class GestureRecognitionThread(QThread): diff --git a/spotify/Spotify.py b/components/Spotify.py similarity index 99% rename from spotify/Spotify.py rename to components/Spotify.py index dc1f31f..515aaee 100644 --- a/spotify/Spotify.py +++ b/components/Spotify.py @@ -1,6 +1,3 @@ -# Katarzyna Zaleska -# WCY19IJ1S1 - import os import requests diff --git a/spotify/__init__.py b/components/__init__.py similarity index 100% rename from spotify/__init__.py rename to components/__init__.py diff --git a/pyui/StartWindow.py b/pyui/StartWindow.py index 4411ef9..9949421 100644 --- a/pyui/StartWindow.py +++ b/pyui/StartWindow.py @@ -1,6 +1,3 @@ -# Katarzyna Zaleska -# WCY19IJ1S1 - # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'StartWindow.ui'