{"id":15646307,"url":"https://github.com/ysh329/darknet2caffe","last_synced_at":"2025-04-30T12:07:36.605Z","repository":{"id":83526597,"uuid":"120782232","full_name":"ysh329/darknet2caffe","owner":"ysh329","description":"Convert Darknet model to Caffe's","archived":false,"fork":false,"pushed_at":"2018-11-18T00:38:38.000Z","size":94,"stargazers_count":50,"open_issues_count":9,"forks_count":21,"subscribers_count":7,"default_branch":"darknet2inferxlite","last_synced_at":"2025-02-25T07:41:49.823Z","etag":null,"topics":["caffe","conversion","darknet","support-conversion","tiny-yolo","yolov2"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ysh329.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":"2018-02-08T15:51:41.000Z","updated_at":"2025-01-12T08:04:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b5ad306-13b9-41b3-a97a-6f68206393ed","html_url":"https://github.com/ysh329/darknet2caffe","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/ysh329%2Fdarknet2caffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysh329%2Fdarknet2caffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysh329%2Fdarknet2caffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysh329%2Fdarknet2caffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysh329","download_url":"https://codeload.github.com/ysh329/darknet2caffe/tar.gz/refs/heads/darknet2inferxlite","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242650896,"owners_count":20163610,"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":["caffe","conversion","darknet","support-conversion","tiny-yolo","yolov2"],"created_at":"2024-10-03T12:12:22.121Z","updated_at":"2025-03-09T05:30:30.656Z","avatar_url":"https://github.com/ysh329.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# darknet2inferx\n\nThis model convertor ported from [original](https://github.com/marvis/pytorch-caffe-darknet-convert) supports conversion from darkent to caffe, especially for YOLOv2 and tiny-YOLO etc. \n\n## Step1 Caffe Environment\n\nFirst, ensure caffe installed (**converison progress'll use Python interface of caffe**), recommanding using [Docker image](https://hub.docker.com/r/bvlc/caffe/) of `bvlc/caffe:cpu` instead.\n\n## Step2 Convert\n\nUse following command, convert darknet model to caffe's:\n\n```shell\npython darknet2caffe.py DARKNET_CFG DARKNET_WEIGHTS\n```\n\nIf last message shows as below, it means successful conversion from darknet to caffe:\n\n```shell\nNetwork initialization done.\n```\n\nNext is conversion from caffe to InferXLite:\n\n```shell\npython caffe2inferx.py CAFFE_PROTOTXT CAFFE_CAFFEMODEL\n```\n\n## Appendix\n\n### darknet2inferx\n\nTranslate to InferXLite directly from darknet:\n\n```shell\npython darknet2inferx.py DARKNET_CFG DARKNET_WEIGHTS\n```\n\nCheck exectuion log in `darknet2caffe_convert.log`.\n\nTranslate `*.cfg` file to `*.prototxt` only:\n\n```shell\npython cfg.py DARKNET_CFG\n```\n\n### Old API\n\nDue to the newest API starting with `inferx_` in `*.c` file (such as `inferx_convolution`), if use old API (without `inferx_`), you should convert to old API using command below:\n\n```shell\npython to_old_api_for_c_file.py INFERX_MODEL_C \n```\n\n\n## TODO\n\n- [x] auto shape infer for output dimension of reorg layer from darknet to caffe, especially for **one-reorg-layer networks** like YOLOv2.\n- [x] darknet2inferx\n   - [x] support converison of region layer's parameters to variables in `*.h` file.\n   - [x] support `yolo_pooling` judge/choose in pooling conversion from caffe to inferxlite [DELAY]\n- [x] darknet2caffe\n   - [x] support conversion of **pooling layer** for a special case (input shape same as output shape. More concretely, stride=1 size=2 max pooling, this case's process of darknet will pad 1 for right and down side of input feature map. Thus, this conversion replaces `stride=1 size=2` with `stride=1 size=1` before `cfg2proto`. After conversion from `weights` to `caffemodel`, an afterward process'll replace pooling setting in cfg file using ground truth params (stride and size) in cfg file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysh329%2Fdarknet2caffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysh329%2Fdarknet2caffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysh329%2Fdarknet2caffe/lists"}