{"id":16840590,"url":"https://github.com/mitmul/pybing","last_synced_at":"2025-04-11T05:41:47.616Z","repository":{"id":32795645,"uuid":"36387928","full_name":"mitmul/pybing","owner":"mitmul","description":"A Python wrapper of OpenCV implementation of BING Objectness","archived":false,"fork":false,"pushed_at":"2017-08-18T15:21:29.000Z","size":11,"stargazers_count":15,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T03:41:38.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitmul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-27T18:41:50.000Z","updated_at":"2022-03-15T09:44:54.000Z","dependencies_parsed_at":"2022-09-12T14:11:41.487Z","dependency_job_id":null,"html_url":"https://github.com/mitmul/pybing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fpybing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fpybing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fpybing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fpybing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitmul","download_url":"https://codeload.github.com/mitmul/pybing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351292,"owners_count":21089268,"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-13T12:37:22.800Z","updated_at":"2025-04-11T05:41:47.598Z","avatar_url":"https://github.com/mitmul.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pybing\n\nA Python wrapper of BING-Objectness in OpenCV (3.0.0-dev) implementation\n\n## Requirement\n\n- CMake (\u003e=2.8)\n- TBB\n- OpenCV (\u003e=3.0.0-dev with opencv_contrib)\n- Boost\n- Boost.Numpy\n\n## Build bing.so\n\nModify some parameters to detect TBB, OpenCV, Boost, and Boost.NumPy, and then\n\n\n    $ bash build.sh\n\n\nIt will make `bing.so` in `build` directory.\n\n## Usage\n\n- BING class requires the path of trained model dir and some parameters\n- The output of `objectness` method is 2D-array of bounding boxes\n  - `[[min_x, min_y, max_x, max_y, score],...]`\n  - Smaller `score` means it has much objectness\n  - Resulting bounding boxes is already sorted in ascending order of `score`, so it's descending order of objectness\n- try `$ python scripts/test_bing.py`\n\n```\nimport cv2 as cv\nimport bing\n\nb = 2  # base_window_size_quantization\nw = 8  # window_size\nn = 2  # non_maximal_supress_size\n\nbinger = bing.BING('build/ObjectnessTrainedModel', b, w, n)\nimg = cv.imread('sample.jpg')\ncanvas = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)\n\nbbox = binger.objectness(img)\nfor b in bbox:\n    x1, y1, x2, y2 = [int(a) for a in b[:4]]\n    s = b[-1]\n    canvas[y1:y2, x1:x2] += s\n\ncanvas /= np.max(canvas)\ncv.imwrite('sample_result.jpg', canvas * 255)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fpybing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmul%2Fpybing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fpybing/lists"}