diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 0000000..384f9b7 --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest diff --git a/Encryption Decryption/encryp_decrypt.py b/Encryption Decryption/encryp_decrypt.py index 757b52b..e1aafe1 100644 --- a/Encryption Decryption/encryp_decrypt.py +++ b/Encryption Decryption/encryp_decrypt.py @@ -1,5 +1,6 @@ +#libraries import base64 - + #Encryption message = input() message_bytes = message.encode('ascii') diff --git a/Hand motion/hand_motion.py b/Hand motion/hand_motion.py index 605753e..7486855 100644 --- a/Hand motion/hand_motion.py +++ b/Hand motion/hand_motion.py @@ -3,12 +3,13 @@ import cv2 import numpy as np import uuid -import os +import os +import tensorflow mp_drawing = mp.solutions.drawing_utils mp_hands = mp.solutions.hands -cap = cv2.VideoCapture(0) #access camera +cap = cv2.VideoCapture(0) #accessing the camera with mp_hands.Hands(min_detection_confidence=0.8, min_tracking_confidence=0.5) as hands: while cap.isOpened(): diff --git a/QR code generator/QRcode_gen.py b/QR code generator/QRcode_gen.py index 177b417..112a320 100644 --- a/QR code generator/QRcode_gen.py +++ b/QR code generator/QRcode_gen.py @@ -1,3 +1,4 @@ +# libraries import pyqrcode import png diff --git a/README.md b/README.md index 53dd33c..e8dcc8d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # PythonML_Examples Different type of solutions using Python. + diff --git a/Random password gen/random_pass_gen.py b/Random password gen/random_pass_gen.py index 2cbbd37..d10a65f 100644 --- a/Random password gen/random_pass_gen.py +++ b/Random password gen/random_pass_gen.py @@ -1,4 +1,5 @@ import random +import ksa lowers = 'abcdefghijklmnopqrstuvwxyz' uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..034e848 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. diff --git a/eye mouse/eye_mouse.py b/eye mouse/eye_mouse.py index 89d3aa0..cde9034 100644 --- a/eye mouse/eye_mouse.py +++ b/eye mouse/eye_mouse.py @@ -1,6 +1,8 @@ +# libraries import cv2 import mediapipe as mp import pyautogui +import tensorflow cam = cv2.VideoCapture(0) diff --git a/face recognition/face_recog.py b/face recognition/face_recog.py index 077753c..a4277f3 100644 --- a/face recognition/face_recog.py +++ b/face recognition/face_recog.py @@ -1,3 +1,4 @@ +# library import cv2 as cv face_cascade = cv.CascadeClassifier('resource/haarcascade_frontalface_default.xml') diff --git a/mask detection/mask_detect.py b/mask detection/mask_detect.py index 71e98f1..d0ebc53 100644 --- a/mask detection/mask_detect.py +++ b/mask detection/mask_detect.py @@ -1,11 +1,8 @@ -import tensorflow.keras -from PIL import Image, ImageOps -import numpy as np -import cv2 -str = '' -faceCascade = cv2.CascadeClassifier('resource/haarcascade_frontalface_default.xml') +str = '' +faceCascade = cv2.CascadeClassifier('resource/haarcascade_frontalface_default.xml') + np.set_printoptions(suppress=True) model = tensorflow.keras.models.load_model('resource/keras_model.h5') data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32) @@ -37,4 +34,4 @@ cv2.imshow('Result', img) if cv2.waitKey(1) & 0xFF == ord('q'): - break + break