{"id":16865809,"url":"https://github.com/hellock/cvbase","last_synced_at":"2025-08-21T19:06:34.980Z","repository":{"id":57417791,"uuid":"84403074","full_name":"hellock/cvbase","owner":"hellock","description":"Utils for computer vision research.","archived":false,"fork":false,"pushed_at":"2018-10-12T16:58:25.000Z","size":1071,"stargazers_count":72,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T18:36:52.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://cvbase.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T05:45:22.000Z","updated_at":"2025-01-16T01:49:03.000Z","dependencies_parsed_at":"2022-08-31T15:22:38.813Z","dependency_job_id":null,"html_url":"https://github.com/hellock/cvbase","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellock%2Fcvbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellock%2Fcvbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellock%2Fcvbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellock%2Fcvbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellock","download_url":"https://codeload.github.com/hellock/cvbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846978,"owners_count":20357297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-13T14:48:33.627Z","updated_at":"2025-03-17T05:32:43.192Z","avatar_url":"https://github.com/hellock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated! Please use [mmcv](https://github.com/open-mmlab/mmcv) instead.\n# Introduction\n\n[![PyPI Version](https://img.shields.io/pypi/v/cvbase.svg)](https://pypi.python.org/pypi/cvbase)\n[![Python Version](https://img.shields.io/pypi/pyversions/cvbase.svg)]()\n[![Build Status](https://travis-ci.org/hellock/cvbase.svg?branch=master)](https://travis-ci.org/hellock/cvbase)\n[![Coverage Status](https://codecov.io/gh/hellock/cvbase/branch/master/graph/badge.svg)](https://codecov.io/gh/hellock/cvbase)\n\n\n`cvbase` is a miscellaneous set of tools which maybe helpful for computer vision research.\nIt comprises the following parts.\n\n- IO helpers\n- Image/Video operations\n- OpenCV wrappers for python2/3 and opencv 2/3\n- Timer\n- Progress visualization\n- Plotting tools\n- Object detection utils\n\nTry and start with\n\n```shell\npip install cvbase\n```\n\nSee [documentation](http://cvbase.readthedocs.io/en/latest) for more features and usage.\n\n## Some popular features\nThere are some popular features such as progress visualization, timer, video to frames/frames to videos.\n\n\n- Progress visualization\n\n    If you want to apply a method to a list of items and track the progress, `track_progress`\n    is a good choice. It will display a progress bar to tell the progress and ETA.\n\n    ```python\n    import cvbase as cvb\n\n    def func(item):\n        # do something\n        pass\n\n    tasks = [item_1, item_2, ..., item_n]\n\n    cvb.track_progress(func, tasks)\n    ```\n\n    The output is like the following.\n    ![progress](docs/_static/progress.gif)\n\n    There is another method `track_parallel_progress`, which wraps multiprocessing and\n    progress visualization.\n\n    ```python\n    import cvbase as cvb\n\n    def func(item):\n        # do something\n        pass\n\n    tasks = [item_1, item_2, ..., item_n]\n\n    cvb.track_parallel_progress(func, tasks, 8)\n    # 8 workers\n    ```\n\n- Timer\n\n    It is convinient to computer the runtime of a code block with `Timer`.\n\n    ```python\n    import time\n\n    with cvb.Timer():\n        # simulate some code block\n        time.sleep(1)\n    ```\n\n    Or try a more flexible way.\n\n    ```python\n    timer = cvb.Timer()\n    # code block 1 here\n    print(timer.since_start())\n    # code block 2 here\n    print(timer.since_last_check())\n    print(timer.since_start())\n    ```\n\n- Video/Frames conversion\n\n    To split a video into frames.\n\n    ```python\n    video = cvb.VideoReader('video_file.mp4')\n    video.cvt2frames('frame_dir')\n    ```\n    Besides `cvt2frames`, `VideoReader` wraps many other useful methods to operate a video like a list object, like\n\n    ```\n    video = cvb.VideoReader('video_file.mp4')\n    len(video)  # get total frame number\n    video[5]  # get the 6th frame\n    for img in video:  # iterate over all frames\n        print(img.shape)\n    ```\n\n    To generate a video from frames, use the `frames2video` method.\n\n    ```python\n    video = cvb.frames2video('frame_dir', 'out_video_file.avi', fps=30)\n    ```\n\n- Video editing (needs ffmpeg)\n\n    To cut a video.\n\n    ```python\n    cvb.cut_video('input.mp4', 'output.mp4', start=3, end=10)\n    ```\n\n    To join two video clips.\n\n    ```python\n    cvb.concat_video(['clip1.mp4', 'clip2.mp4'], 'output.mp4')\n    ```\n\n    To resize a video.\n\n    ```python\n    cvb.resize_video('input.mp4', 'resized.mp4', (360, 240))\n    # or\n    cvb.resize_video('input.mp4', 'resized.mp4', ratio=2)\n    ```\n\n    To convert the format of a video.\n\n    ```python\n    cvb.convert_video('input.avi', 'output.mp4', vcodec='h264')\n    ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellock%2Fcvbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellock%2Fcvbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellock%2Fcvbase/lists"}