{"id":51186286,"url":"https://github.com/syrax90/dynamic-solov2-tensorflow2","last_synced_at":"2026-06-27T10:04:06.013Z","repository":{"id":293620430,"uuid":"984642811","full_name":"syrax90/dynamic-solov2-tensorflow2","owner":"syrax90","description":"Dynamic SOLOv2 implementation in TensorFlow 2 for real-time instance segmentation.","archived":false,"fork":false,"pushed_at":"2026-02-23T09:07:37.000Z","size":4045,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-23T17:54:39.916Z","etag":null,"topics":["computer-vision","instance-segmentation","solov2","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"https://syrax90.github.io/dynamic-solov2-tensorflow2/","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/syrax90.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-16T09:08:33.000Z","updated_at":"2026-02-23T09:07:42.000Z","dependencies_parsed_at":"2025-07-16T23:20:14.753Z","dependency_job_id":"827f0934-2053-416e-915c-04cbe145b7fa","html_url":"https://github.com/syrax90/dynamic-solov2-tensorflow2","commit_stats":null,"previous_names":["syrax90/dynamicsolotf2","syrax90/dynamic-solov2-tensorflow2"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/syrax90/dynamic-solov2-tensorflow2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrax90%2Fdynamic-solov2-tensorflow2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrax90%2Fdynamic-solov2-tensorflow2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrax90%2Fdynamic-solov2-tensorflow2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrax90%2Fdynamic-solov2-tensorflow2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syrax90","download_url":"https://codeload.github.com/syrax90/dynamic-solov2-tensorflow2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrax90%2Fdynamic-solov2-tensorflow2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34848983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","instance-segmentation","solov2","tensorflow","tensorflow2"],"created_at":"2026-06-27T10:04:05.408Z","updated_at":"2026-06-27T10:04:06.005Z","avatar_url":"https://github.com/syrax90.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic SOLO (SOLOv2) with TensorFlow\n\nThis project is an implementation of \u003cstrong\u003eDynamic SOLO (SOLOv2)\u003c/strong\u003e using the TensorFlow framework. The goal is to provide a clear explanation of how Dynamic SOLO works and demonstrate how the model can be implemented with TensorFlow.  \n[SOLOv2 Tensorflow](https://github.com/syrax90/dynamic-solov2-tensorflow2)\n\n## About SOLO\n\nSOLO (Segmenting Objects by Locations) is a model designed for computer vision tasks, specifically instance segmentation.\n\u003e [**SOLO: A Simple Framework for Instance Segmentation**](https://arxiv.org/abs/2106.15947),  \n\u003e Xinlong Wang, Rufeng Zhang, Chunhua Shen, Tao Kong, Lei Li  \n\u003e *arXiv preprint ([arXiv:2106.15947](https://arxiv.org/abs/2106.15947))*  \n\nTo understand instance segmentation better, consider the example below, where multiple objects—whether of the same or different classes—are identified as separate instances, each with its own segmentation mask (and the probability of belonging to a certain class):   \n\n![Instance segmentation picture](images/readme/my_photo_with_masks.png)  \n\nThis project implements the \u003cstrong\u003eDynamic SOLO (SOLOv2)\u003c/strong\u003e variant:  \n\n![Dynanic SOLO plot](images/readme/dynamic_solo_plot_my_photo.png)\n\n## Who This Project is For\n\nIt is primarily intended for educational purposes—especially for individuals without high-performance GPUs who are interested in learning about computer vision and the SOLO model. We chose TensorFlow to make the implementation accessible. The code is thoroughly documented to ensure clarity and ease of understanding. However, the code is well optimized for use in production-ready tasks.\n\n## Installation, Dependencies, and Requirements\n\n- Python 3.12.3 is required.\n- All dependencies are listed in `requirements.txt`.\n- Use `setup.sh` to install all dependencies on Linux.\n\nThe project has been tested on \u003cstrong\u003eUbuntu 24.04.2 LTS\u003c/strong\u003e with \u003cstrong\u003envcr.io/nvidia/tensorflow:25.02-tf2-py3 container using TensorFlow 2.17.0\u003c/strong\u003e. It may work on other operating systems and TensorFlow versions (older than 2.17.0), but we cannot guarantee compatibility.\n\n\u003e \u003cstrong\u003eNote:\u003c/strong\u003e A GPU with CUDA support is highly recommended to speed up training. The project currently does not support multi-GPU training.\n\n## Datasets\n\nThe code supports datasets in the COCO format. We recommend creating your own dataset to better understand the full training cycle, including data preparation. [LabelMe](https://github.com/wkentaro/labelme) is a good tool for this. You don’t need a large dataset or many classes to begin training and see results. This makes it easier to experiment and learn without requiring powerful hardware.  \nAlternatively, you can use the original [COCO dataset](https://cocodataset.org/#home), which contains 80 object categories.\n\nFor high-performance tasks we recommend using the dataset generator from `coco_dataset_optimized.py`. The dataset interacts with TFRecord format files using parallel reading and compatible with TensorFlow Graph Mode. To use the dataset, follow these steps:\n1) Convert your COCO dataset to TFRecord files:\n```\npython convert_coco_to_tfrecord.py \\\n  --images_root /path/to/images \\\n  --annotations /path/to/instances_train.json \\\n  --output /path/to/out/train.tfrecord \\\n  --num_shards 4\n```\n2) Set corresponding settings in `config.py` file:\n```\nself.use_optimized_dataset = True\nself.tfrecord_dataset_directory_path = 'path/to/tfrecords/directory'\n```\n\n## Configuration\n\nAll configuration parameters are defined in `config.py` file within the `DynamicSOLOConfig` class.\n\nSet the path to your COCO dataset:  \n\n```\nself.coco_root_path = '/path/to/your/coco/dataset'\n```\n\nSet the path to the dataset's annotation file:  \n\n```\nself.train_annotation_path = f'{self.coco_root_path}/annotations/instances_train2017.json'\n```\n\nYou have to generate a file containing a list of classes. For example `coco_classes.txt`. It is located next to the project as an example. Set the path to the classes file:  \n\n```\nself.classes_path = 'data/coco_classes.txt'\n```\n\nSet the path to the training images:  \n\n```\nself.images_path = f'{self.coco_root_path}/train2017/'\n```\n\nAnd you can find other intuitive parameters:\n\n```\n# Image parameters\nself.img_height = 480\nself.img_width = 480\n\n# If load_previous_model = True: load the previous model weights\nself.load_previous_model = True\nself.lr = 0.001\nself.batch_size = 32\n# If load_previous_model = True, the code will look for the latest checkpoint in this directory or use this path if it is a specific checkpoint file.\nself.model_path = './checkpoints'    # example for specific checkpoint: self.model_path = './checkpoints/ckpt-5'\n\n# Save the model weights every save_iter epochs:\nself.save_iter = 1\n```\n\n## Training\n\nTo start training, run:\n\n```\npython train.py\n```\n\nModel weights and the optimizer state are saved in the `checkpoints` directory every `cfg.save_iter` epochs.\n\nTo proceed training:\n\n1) Set configuration parameter `load_previous_model` to `True`:\n\n```\nself.load_previous_model = True\n```\n\n2) Set the path to a specific file if you want to load certain weights:\n\n```\nself.model_path = './checkpoints/ckpt-5'\n```\n\n## Testing\n\nTo test the model:\n\n1) Move your test images in the `/images/test` directory.\n\n2) In the config file, set the path to a specific file if you want to load certain weights:\n\n```\nself.test_model_path = './checkpoints/ckpt-5'\n```\n\n3) Run the test script:\n\n```\npython test.py\n```\n\nOutput images with masks, class labels, and probabilities will be saved in the `/images/res` directory.\n\n## Dataset Evaluation\n\nIt is possible to evaluate the data fed to the model before training to ensure that the masks, classes, and scales are applied correctly:\n\n```\npython test_dataset.py\n```\n\nThis script generates images with instance masks and their corresponding category labels. The outputs are saved in `images/dataset_test`.\n\nBy default, it processes the first 20 images. To change or remove this limit, edit `test_dataset.py`:\n\n```\nnumber_images=20\n```\n\n\n## Thank you!\n\nWe appreciate your interest and contributions toward improving this project. Happy learning!\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyrax90%2Fdynamic-solov2-tensorflow2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyrax90%2Fdynamic-solov2-tensorflow2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyrax90%2Fdynamic-solov2-tensorflow2/lists"}