{"id":21395965,"url":"https://github.com/khalidelboray/cv-aid","last_synced_at":"2026-02-17T18:32:13.761Z","repository":{"id":45015941,"uuid":"446208997","full_name":"khalidelboray/cv-aid","owner":"khalidelboray","description":"CV Aid is a set of helpers for computer vision tasks.","archived":false,"fork":false,"pushed_at":"2022-07-15T02:17:11.000Z","size":2435,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-07T17:51:24.768Z","etag":null,"topics":["computer-vision","haar-cascade","opencv","python3"],"latest_commit_sha":null,"homepage":"https://khalidelboray.me/cv-aid/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khalidelboray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-09T21:39:50.000Z","updated_at":"2022-03-20T17:25:02.000Z","dependencies_parsed_at":"2022-09-24T21:32:30.078Z","dependency_job_id":null,"html_url":"https://github.com/khalidelboray/cv-aid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khalidelboray/cv-aid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidelboray%2Fcv-aid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidelboray%2Fcv-aid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidelboray%2Fcv-aid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidelboray%2Fcv-aid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khalidelboray","download_url":"https://codeload.github.com/khalidelboray/cv-aid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidelboray%2Fcv-aid/sbom","scorecard":{"id":558731,"data":{"date":"2025-08-11","repo":{"name":"github.com/khalidelboray/cv-aid","commit":"6e4c1d240325d2dc15f460a11a195f6338613d93"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"23 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: GHSA-6673-4983-2vx5","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-qr4w-53vh-m672","Warn: Project is vulnerable to: PYSEC-2023-183","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2023-175","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T13:01:17.118Z","repository_id":45015941,"created_at":"2025-08-20T13:01:17.118Z","updated_at":"2025-08-20T13:01:17.118Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29552795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T18:16:07.221Z","status":"ssl_error","status_checked_at":"2026-02-17T18:16:04.782Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","haar-cascade","opencv","python3"],"created_at":"2024-11-22T14:24:12.613Z","updated_at":"2026-02-17T18:32:08.753Z","avatar_url":"https://github.com/khalidelboray.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cv-aid\n\nCV Aid is a set of helpers of computer vision tasks.\n\n## Installation\n\n`pip install cv-aid`\n\n### From source\n\n```bash\ngit clone https://github.com/khalidelboray/cv-aid\ncd cv-aid\npoetry install\npoetry run python setup.py install\n```\n\n## Tests\n\n`poetry run test`\n\nall tests are in `tests/` directory.\n\n## Examples\n\n- Basic Frame Functions\n\n    ```python\n    from cv_aid import Frame\n\n    frame = Frame.load('/path/to/image.jpg')\n    # or\n    import cv2\n    frame = Frame(cv2.imread('/path/to/image.jpg'))\n\n    # Grayscale image\n    gray = frame.gray()\n\n    # Resize image\n    small = frame.resize(width=100, height=100)\n\n    # Crop image\n    cropped = frame.crop(x=100, y=100, width=100, height=100)\n\n    # All methods return a new Frame object, so you can chain them\n    new_frame = frame.resize(width=100, height=100).crop(x=100, y=100, width=100, height=100)\n\n    # Save image\n    frame.save('/path/to/image.jpg')\n    ```\n\n- Basic Video Functions\n\n    ```python\n    from cv_aid import VideoStream, Frame\n    import cv2\n    import numpy as np\n\n\n    def on_frame(frame: Frame) -\u003e Frame:\n        \"\"\"\n        A function that is called when a frame is read from the video stream.\n\n        :param frame: The frame that was read.\n        :return: The frame that was read.\n        \"\"\"\n        orig = frame\n        canny = frame.gray().canny(50, 100)\n        line_image = Frame(np.copy(orig.frame) * 0)\n        lines = cv2.HoughLinesP(\n            canny.frame, 1, np.pi / 180, 50, np.array([]), minLineLength=10, maxLineGap=5\n        )\n        if lines is not None:\n            for line in lines:\n                line = line[0]\n                line_image = line_image.line(\n                    (line[0], line[1]), (line[2], line[3]), (0, 255, 0), 3\n                )\n        lines_edges = cv2.addWeighted(orig.frame, 0.8, line_image.frame, 1, 1)\n        return Frame(lines_edges)\n\n\n    stream = VideoStream(src=0, on_frame=on_frame).start()\n    stream.start_window()\n    ```\n\n    *Output Demo:*\n\n    ![Code Window](https://raw.githubusercontent.com/khalidelboray/cv-aid/master/images/stream.png)\n\n- Haar Cascade Functions\n\n    ```python\n    from cv_aid import VideoStream, Frame\n\n    def on_frame(frame: Frame) -\u003e Frame:\n        \"\"\"\n        A function that is called when a frame is read from the video stream.\n\n        :param frame: The frame that was read.\n        :return: The frame that was read.\n        \"\"\"\n        boxes = frame.haarcascades.detect_faces(frame.frame, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))\n        frame = frame.boxes(boxes, color=(0, 255, 0))\n        return frame\n\n\n    if __name__ == \"__main__\":\n\n        stream = VideoStream(src=0, on_frame=on_frame).start()\n        stream.start_window()\n    ```\n\n    *Output Demo:*\n\n    ![haarcascade Window](https://raw.githubusercontent.com/khalidelboray/cv-aid/master/images/haarcascades.png)\n\n- Tourch Hub (Yolov5)\n\n    ```python\n    from cv_aid import VideoStream, Frame\n    import torch\n\n    model = torch.hub.load('ultralytics/yolov5', 'yolov5s')\n\n    def on_frame(frame: Frame) -\u003e Frame:\n        \"\"\"\n        A function that is called when a frame is read from the video stream.\n\n        :param frame: The frame that was read.\n        :return: The frame that was read.\n        \"\"\"\n        results = model(frame.frame)\n        results.display(render=True)\n        frame = Frame(results.imgs[0])    \n        return frame\n\n\n    if __name__ == \"__main__\":\n        \n        stream = VideoStream(src=0, on_frame=on_frame).start()\n        stream.start_window()\n    ```\n\n    ![torch yolov5](https://raw.githubusercontent.com/khalidelboray/cv-aid/master/images/torch_yolo.png)\n\n- Dlib (`Download model`)\n\n    ```python\n    from cv_aid._dlib import Dlib\n    saved_model = Dlib.download_landmark_detector(path='/dir/to/download/model/at/')\n    dlib = Dlib(landmark_predictor_path=saved_model)\n\n    face_recognetion_model = Dlib.download_face_recognition_model_v1(path='/dir/to/download/model/at/')\n    ```\n\n- Dlib (Face landmark)\n\n    `Give it a try!`\n\n    ```python\n    # pylint: disable=C0103\n\n    import math\n\n    import cv2\n    import numpy as np\n    from skimage.draw import disk, polygon, set_color\n\n    from cv_aid import Frame, VideoStream\n\n    RIGHT_EYE_POINTS = list(range(36, 42))\n    LEFT_EYE_POINTS = list(range(42, 48))\n\n\n    def get_poly_data(desired, landmarks, shape):\n        points = []\n        for i in desired:\n            points.append((landmarks.part(i).x, landmarks.part(i).y))\n        points = np.array(points, dtype=np.int32)\n        rr, cc = polygon(points[:, 1], points[:, 0], shape)\n        return points, rr, cc\n\n\n    def on_frame(frame: Frame) -\u003e Frame:\n        \"\"\"\n        A function that is called when a frame is read from the video stream.\n\n        :param frame: The frame that was read.\n        :return: The frame that was read.\n        \"\"\"\n\n        faces = frame.dlib.detect_faces(frame.frame)\n        for face in faces:\n            face_landmarks = frame.dlib.detect_landmarks(frame.frame, face)\n            left_eye, *_ = get_poly_data(LEFT_EYE_POINTS, face_landmarks, frame.shape)\n            right_eye, *_ = get_poly_data(RIGHT_EYE_POINTS, face_landmarks, frame.shape)\n\n            left_eye_center = left_eye.mean(axis=0).astype(\"int\")\n            right_eye_center = right_eye.mean(axis=0).astype(\"int\")\n            left_eye_radius = (\n                int(\n                    math.sqrt(\n                        (left_eye[3][0] - left_eye[0][0]) ** 2\n                        + (left_eye[3][1] - left_eye[0][1]) ** 2\n                    )\n                )\n                - 10\n            )\n            right_eye_radius = (\n                int(\n                    math.sqrt(\n                        (right_eye[3][0] - right_eye[0][0]) ** 2\n                        + (right_eye[3][1] - right_eye[0][1]) ** 2\n                    )\n                )\n                - 10\n            )\n            frame = (\n                # Glasses connection line\n                frame.line(\n                    (left_eye_center[0] - left_eye_radius, left_eye_center[1]),\n                    (right_eye_center[0] + right_eye_radius, right_eye_center[1]),\n                    (0, 0, 0),\n                    4,\n                )\n                # Glasses circle 1 *Border*\n                .circle(\n                    left_eye_center,\n                    left_eye_radius,\n                    (0, 0, 0),\n                    4,\n                )\n                # Glasses circle 1\n                .circle(\n                    left_eye_center,\n                    left_eye_radius,\n                    (0, 0, 255),\n                    2,\n                )\n                # Glasses circle 2 *Border*\n                .circle(\n                    right_eye_center,\n                    right_eye_radius,\n                    (0, 0, 0),\n                    4,\n                )\n                # Glasses circle 2\n                .circle(\n                    right_eye_center,\n                    right_eye_radius,\n                    (0, 0, 255),\n                    2,\n                )\n                # Ears connection line 1\n                .line(\n                    (face_landmarks.part(0).x, face_landmarks.part(0).y),\n                    (right_eye_center[0] - right_eye_radius, right_eye_center[1]),\n                    (0, 0, 255),\n                    2,\n                )\n                # Ears connection line 1\n                .line(\n                    (face_landmarks.part(16).x, face_landmarks.part(16).y),\n                    (left_eye_center[0] + left_eye_radius, left_eye_center[1]),\n                    (0, 0, 255),\n                    2,\n                )\n            )\n            # Overlay the frame with the image of the glasses colored in transparent black\n            overlay = frame.frame.copy()\n            alpha = 0.5\n            # Get first circle rows and columns (pixel coordinates)\n            rr, cc = disk(right_eye_center[::-1], right_eye_radius)\n            # Set the color of the circle\n            set_color(overlay, (rr, cc), (0, 0, 0))\n\n            # Get second circle rows and columns (pixel coordinates)\n            rr, cc = disk(left_eye_center[::-1], left_eye_radius)\n            # Set the color of the circle\n            set_color(overlay, (rr, cc), (0, 0, 0))\n\n            # Overlay the image with the overlay image\n            frame.frame = cv2.addWeighted(overlay, alpha, frame.frame, 1 - alpha, 0)\n\n        return frame\n\n\n    if __name__ == \"__main__\":\n\n        stream = VideoStream(src=0, on_frame=on_frame).start()\n        stream.start_window()\n\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidelboray%2Fcv-aid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalidelboray%2Fcv-aid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidelboray%2Fcv-aid/lists"}