Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deuteronomy-works/soloman
For the love of Artificial Intelligence, Python and QML
https://github.com/deuteronomy-works/soloman
artificial-intelligence data-science data-visualisation image-recognition machine-learning opencv python qml
Last synced: 28 days ago
JSON representation
For the love of Artificial Intelligence, Python and QML
- Host: GitHub
- URL: https://github.com/deuteronomy-works/soloman
- Owner: deuteronomy-works
- License: mit
- Created: 2020-04-01T21:49:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-06T18:34:14.000Z (over 2 years ago)
- Last Synced: 2024-04-26T00:26:02.024Z (7 months ago)
- Topics: artificial-intelligence, data-science, data-visualisation, image-recognition, machine-learning, opencv, python, qml
- Language: Python
- Homepage:
- Size: 70 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# soloman [![Downloads](https://pepy.tech/badge/soloman/month)](https://pepy.tech/project/soloman)
For the love of Artificial Intelligence, Python and QML[refer to milestone](https://github.com/deuteronomy-works/soloman/milestone/12)
## Installation
pip install soloman## Python Usage
### Play audio
```python
from soloman import Audioaud = Audio()
aud.play('/path/to/music.mp3')
```## Qml Usage
example.py
```python
import soloman
...
engine = QQmlApplicationEngine()
...
engine.load('example.qml')```
### Play audio
*example.qml***Qt6**
```qml
import QtQuick
...
import solomanSAudio {
id: aud
}Button {
text: "Play"
onClicked: aud.play('path/to/music.mp3')
}```
**Qt5**
```qml
import QtQuick 2.15
...
import soloman 3.0SAudio {
id: aud
}Button {
text: "Play"
onClicked: aud.play('path/to/music.mp3')
}```
### Play videos
*example.qml*#### Play a video file
**Qt6**
```qml
import QtQuick
...
import solomanSVideo {
id: vid
}Button {
text: "Play video"
onClicked: vid.play('path/to/video.mp4')
}
```**Qt5**
```qml
import QtQuick 2.15
...
import soloman 3.0SVideo {
id: vid
}Button {
text: "Play video"
onClicked: vid.play('path/to/video.mp4')
}
```### Play stills
##### Option one
```qml
...
onClicked: vid.play('path/to/video_stills_01.jpg') # possibly the first image
...
```##### Option two
```qml
...
onClicked: vid.play('path/to/') # make sure folder contains only stills
...
```### Show cv2 frame
example.py
```python
import sys
import cv2
import threading
from time import sleepfrom PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml QQmlApplicationEngine
import solomanapp = QGuiApplication(sys.argv)
# Create a QML engine.
engine = QQmlApplicationEngine()
engine.quit.connect(app.quit)
engine.load(QUrl('example.qml'))# Get SVideo
vid = soloman.Video(engine)
vid.get_SVideo('screen_01') # objectName goes here# Capture
capture = cv2.VideoCapture(0) # capture cameradef start_capt():
# start thread
o_thread = threading.Thread(target=_start_capt)
o_thread.daemon = True
o_thread.start()def _start_capt():
while True:
ret, frame = capture.read()
if not ret:
breakvid.show_frame(frame)
sleep(1/24)# Call to start capturing
start_capt()# Run the app
ret_value = app.exec_()
capture.release()
sys.exit(0)
```example.qml
**Qt6**
```qml
import QtQuick
import QtQuick.Controls.Basic
import solomonApplicationWindow {
visible: true
width: 800
height: 500SVideo {
objectName: "screen_01" // declare objectName to be used in python
}
}
```**Qt5**
```qml
import QtQuick 2.15
import QtQuick.Controls 2.15
import solomon 3.0ApplicationWindow {
visible: true
width: 800
height: 500SVideo {
objectName: "screen_01" // declare objectName to be used in python
}
}
```## Wiki
The wiki can be located [here](https://github.com/deuteronomy-works/soloman/wiki)