{"id":22066143,"url":"https://github.com/lucasvandroux/kittipy","last_synced_at":"2025-05-13T01:55:36.781Z","repository":{"id":147362945,"uuid":"106798815","full_name":"LucasVandroux/KittiPy","owner":"LucasVandroux","description":"Python functions to import and display the images and labels from the Kitty Object Detection Evaluation 2012 Dataset.","archived":false,"fork":false,"pushed_at":"2017-12-08T08:12:51.000Z","size":5895,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T01:55:34.592Z","etag":null,"topics":["eth-zurich","image-detection","kitti-dataset","python","python-functions","self-driving-car","tsinghua-university"],"latest_commit_sha":null,"homepage":"","language":"Python","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/LucasVandroux.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-13T08:32:56.000Z","updated_at":"2022-02-24T00:19:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed78e998-ce61-4f7a-9ddd-6b1f66564205","html_url":"https://github.com/LucasVandroux/KittiPy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucasVandroux%2FKittiPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucasVandroux%2FKittiPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucasVandroux%2FKittiPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucasVandroux%2FKittiPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucasVandroux","download_url":"https://codeload.github.com/LucasVandroux/KittiPy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253856639,"owners_count":21974577,"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":["eth-zurich","image-detection","kitti-dataset","python","python-functions","self-driving-car","tsinghua-university"],"created_at":"2024-11-30T19:26:11.765Z","updated_at":"2025-05-13T01:55:36.772Z","avatar_url":"https://github.com/LucasVandroux.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KittiPy\n**Python functions to import and display the images and labels from the [Kitty Object Detection Evaluation 2012 Dataset](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=2d).**\n\n![Examples of uses of KittiPy](https://i.imgur.com/STCsquT.jpg)\n\n## Prerequisites\n\n- [python](https://www.python.org/) ≥ _v2.7.6_\n- [scipy](https://www.scipy.org/) ≥ _v0.19.1_                  \n- [matplotlib](https://matplotlib.org/) ≥ _v1.5.2_\n- [numpy](http://www.numpy.org/) ≥ _v1.13.3_\n\n## Installing\n\n1. Copy the file `kittipy.py` in the same directory as the python script or Jupyter notebook you want to use it with.\n2. _(Optional)_ Modify the `kittipy.py` global parameters at the begining\n3. At the begining of your file, add the line: `from kittipy import *`\n4. Enjoy!\n\n## How to use it\n### Explore Folder\nTo get the **numpy array** containing all the ids of the images contained in a folder, use the function:\n```\nget_data_list(im_set, db_absolute_path = ABSOLUTE_PATH)\n```\n| Arguments             | Default                   | Description                                    |\n| ----------------------|---------------------------|------------------------------------------------|\n| `im_set`              |                           | **[string]** 'train' or 'test' to chose the type of set  |\n| `db_absolute_path`    | _ABSOLUTE_PATH_           | **[string]** absolute path to the Kitti root folder |\n\n\n\n### Import Image\nTo import images as a **numpy array**, use the function:\n```\nimport_im(im_id, im_set, db_absolute_path = ABSOLUTE_PATH)\n```\n| Arguments             | Default                   | Description                                    |\n| ----------------------|---------------------------|------------------------------------------------|\n| `im_id`               |                           | **[int]** corresponding to the image id in the kitti dataset  |\n| `im_set`              |                           | **[string]** 'train' or 'test' to chose the type of set  |\n| `db_absolute_path`    | _ABSOLUTE_PATH_           | **[string]** absolute path to the Kitti root folder |\n\n### Import Labels\nTo import the labels as a **list of python dictionaries**, use the function:\n\n```\nimport_labels(im_id, im_set, db_absolute_path = ABSOLUTE_PATH)\n```\n| Arguments             | Default                   | Description                                    |\n| ----------------------|---------------------------|------------------------------------------------|\n| `im_id`               |                           | **[int]** corresponding to the image id in the kitti dataset  |\n| `im_set`              |                           | **[string]** 'train' or 'test' to chose the type of set  |\n| `db_absolute_path`    | _ABSOLUTE_PATH_           | **[string]** absolute path to the Kitti root folder |\n\n#### Description of the fields of the dictionary\n| Fields                     | Description                                    |\n| ------------------------------|------------------------------------------------|\n| `type`                        | **[string]** 'Car', 'Van', 'Truck', 'Pedestrian', 'Person_sitting', 'Cyclist', 'Tram', 'Misc' or 'DontCare'  |\n| `truncated`                   | **[float]** Float from 0 (non-truncated) to 1 (truncated), where truncated refers to the object leaving the image boundaries  |\n| `occluded`                    | **[int]** Integer (0,1,2,3) indicating occlusion state: 0 = fully visible, 1 = partly occluded, 2 = largely occluded, 3 = unknown  |\n| `alpha`                       | **[float]** Observation angle of an object [-pi..pi]   |\n| `bbox`                        | **[dict][float]** `x_min`, `y_min`, `x_max`, `y_max` pixel coordinates (0-based index)  |\n| `3D_dim`                      | **[dict][float]** `height`, `width`, `length` (in meters)   |\n| `3D_loc`                      | **[dict][float]** `x`, `y`, `z` in camera coordinates (in meters)  |\n| `rotation_y`                  | **[float]** around Y-axis in camera coordinates [-pi..pi] |\n| `score` _(Optional)_          | **[float]** Only for results, indicating confidence in detection, needed for p/r curves, higher is better.  |\n\n\n### Display Image + Labels\nTo display a image and its labels in a **Jupyter Notebook**, use the function:\n```\ndisplay_im(im, labels = [], display_boxes = True, display_info = True, \n           types_to_display = DEFAULT_TYPES_TO_DISPLAY, \n           info_to_display = DEFAULT_INFO_TO_DISPLAY, \n           db_absolute_path = ABSOLUTE_PATH, im_width = FIG_WIDTH, \n           im_height = FIG_HEIGHT, display_axis = False, \n           title = '', display_center_boxes = True, num_cell_grid = 0)\n```\n| Arguments             | Default                   | Description                |\n| ----------------------|---------------------------|----------------------------|\n| `im`                  |                           | **[numpy.array]** Image to display  |\n| `labels`              | _[]_                      | **[list][dict]** List of dictionaries containing the labels of the image  |\n| `display_boxes`       | _True_                    | **[bool]** Display the boxes around the objects |\n| `display_info`        | _True_                    | **[bool]** Write the `info_to_display` under the image  |\n| `types_to_display`    | _DEFAULT_TYPES_TO_DISPLAY_| **[list]** List of types of object to consider |\n| `info_to_display`     | _DEFAULT_INFO_TO_DISPLAY_ | **[list]** List of characteritics of object to display |\n| `im_width`            | _FIG_WIDTH_               | **[int]** Width of the image to display |\n| `im_height`           | _FIG_HEIGHT_              | **[int]** Height of the image to display |\n| `display_axis`        | _False_                   | **[bool]** Display the axis of the image |\n| `title`               | _''_                      | **[string]** Title to write before the image |\n| `display_center_boxes`| _True_                    | **[bool]** Display the center of the boxes |\n| `num_cell_grid`       | _0_                       | **[int]** Display a `num_cell_grid` x `num_cell_grid` over the image|\n\n**Remarks**: To change `FIG_FONT_SIZE_TITLE`, `COLOR_GRID` and `COLOR_TYPE` do it in the global variables at the begining of the `kittipy.py` file.\n\n### Example\n**Code** _(Jupyter Notebook)_\n```python\nlist_ids = get_data_list('train')\nimage = import_im(list_ids[3], 'train')\nlabels = import_labels(list_ids[3], 'train')\ndisplay_im(image, labels, num_cell_grid = 10)\n```\n**Output**\n\n![Output of the code above](https://i.imgur.com/tOG55Qs.png)\n\n## Author\n\n* **Lucas Vandroux (冯凯)** [【Github】](https://github.com/LucasVandroux) [【LinkedIn】](https://www.linkedin.com/in/lucasvandroux/)\n\nI started this project to help me during my Master Thesis at Tsinghua University in China. If you find it useful, don't hesitate to use it and improve it.\n\n---\n![Logos Footer](https://i.imgur.com/bCStMxt.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasvandroux%2Fkittipy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasvandroux%2Fkittipy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasvandroux%2Fkittipy/lists"}