{"id":23757638,"url":"https://github.com/broadinstitute/keras-rcnn","last_synced_at":"2025-05-16T14:09:00.327Z","repository":{"id":37444713,"uuid":"89364221","full_name":"broadinstitute/keras-rcnn","owner":"broadinstitute","description":"Keras package for region-based convolutional neural networks (RCNNs)","archived":false,"fork":false,"pushed_at":"2020-05-20T00:44:02.000Z","size":5321,"stargazers_count":555,"open_issues_count":71,"forks_count":221,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-12T12:51:48.760Z","etag":null,"topics":["cntk","deep-learning","image-segmentation","object-detection","tensorflow","theano"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broadinstitute.png","metadata":{"files":{"readme":"README.rst","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":"2017-04-25T13:32:06.000Z","updated_at":"2025-02-14T14:42:14.000Z","dependencies_parsed_at":"2022-08-19T17:00:58.538Z","dependency_job_id":null,"html_url":"https://github.com/broadinstitute/keras-rcnn","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadinstitute%2Fkeras-rcnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadinstitute%2Fkeras-rcnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadinstitute%2Fkeras-rcnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadinstitute%2Fkeras-rcnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broadinstitute","download_url":"https://codeload.github.com/broadinstitute/keras-rcnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544157,"owners_count":22088808,"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":["cntk","deep-learning","image-segmentation","object-detection","tensorflow","theano"],"created_at":"2024-12-31T19:49:49.661Z","updated_at":"2025-05-16T14:08:55.320Z","avatar_url":"https://github.com/broadinstitute.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Keras-RCNN\n==========\n\n.. image:: https://travis-ci.org/broadinstitute/keras-rcnn.svg?branch=master\n    :target: https://travis-ci.org/broadinstitute/keras-rcnn\n\n.. image:: https://codecov.io/gh/broadinstitute/keras-rcnn/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/broadinstitute/keras-rcnn\n\nkeras-rcnn is *the* Keras package for region-based convolutional\nneural networks.\n\nRequirements\n---------------\nPython 3\n\nkeras-resnet==0.2.0\n\nnumpy==1.16.2\n\ntensorflow==1.13.1\n\nKeras==2.2.4\n\nscikit-image==0.15.0\n\n\nGetting Started\n---------------\n\nLet’s read and inspect some data:\n\n.. code:: python\n\n    training_dictionary, test_dictionary = keras_rcnn.datasets.shape.load_data()\n\n    categories = {\"circle\": 1, \"rectangle\": 2, \"triangle\": 3}\n\n    generator = keras_rcnn.preprocessing.ObjectDetectionGenerator()\n\n    generator = generator.flow_from_dictionary(\n        dictionary=training_dictionary,\n        categories=categories,\n        target_size=(224, 224)\n    )\n\n    validation_data = keras_rcnn.preprocessing.ObjectDetectionGenerator()\n\n    validation_data = validation_data.flow_from_dictionary(\n        dictionary=test_dictionary,\n        categories=categories,\n        target_size=(224, 224)\n    )\n\n    target, _ = generator.next()\n    \n    target_bounding_boxes, target_categories, target_images, target_masks, target_metadata = target\n\n    target_bounding_boxes = numpy.squeeze(target_bounding_boxes)\n\n    target_images = numpy.squeeze(target_images)\n\n    target_categories = numpy.argmax(target_categories, -1)\n\n    target_categories = numpy.squeeze(target_categories)\n\n    keras_rcnn.utils.show_bounding_boxes(target_images, target_bounding_boxes, target_categories)\n\n\nLet’s create an RCNN instance:\n\n.. code:: python\n\n    model = keras_rcnn.models.RCNN((224, 224, 3), [\"circle\", \"rectangle\", \"triangle\"])\n\nand pass our preferred optimizer to the `compile` method:\n\n.. code:: python\n\n    optimizer = keras.optimizers.Adam(0.0001)\n\n    model.compile(optimizer)\n\nFinally, let’s use the `fit_generator` method to train our network:\n\n.. code:: python\n\n    model.fit_generator(    \n        epochs=10,\n        generator=generator,\n        validation_data=validation_data\n    )\n\nExternal Data\n-------------\n\nThe data is made up of a list of dictionaries corresponding to images. \n\n* For each image, add a dictionary with keys 'image', 'objects'\n    * 'image' is a dictionary, which contains keys 'checksum', 'pathname', and 'shape'\n        * 'checksum' is the md5 checksum of the image\n        * 'pathname' is the pathname of the image, put in full pathname\n        * 'shape' is a dictionary with keys 'r', 'c', and 'channels'\n            * 'c': number of columns\n            * 'r': number of rows\n            * 'channels': number of channels\n    * 'objects' is a list of dictionaries, where each dictionary has keys 'bounding_box', 'category'\n        * 'bounding_box' is a dictionary with keys 'minimum' and 'maximum'\n            * 'minimum': dictionary with keys 'r' and 'c'\n                * 'r': smallest bounding box row\n                * 'c': smallest bounding box column\n            * 'maximum': dictionary with keys 'r' and 'c'\n                * 'r': largest bounding box row\n                * 'c': largest bounding box column\n        * 'category' is a string denoting the class name\n\nSuppose this data is save in a file called training.json. To load data,\n\n.. code:: python\n\n    import json\n\n    with open('training.json') as f:\n        d = json.load(f)\n\n\nSlack\n-----\n\nWe’ve been meeting in the #keras-rcnn channel on the keras.io Slack\nserver. \n\nYou can join the server by inviting yourself from the following website:\n\nhttps://keras-slack-autojoin.herokuapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroadinstitute%2Fkeras-rcnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroadinstitute%2Fkeras-rcnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroadinstitute%2Fkeras-rcnn/lists"}