{"id":21910483,"url":"https://github.com/chenshen03/marginhash-pytorch","last_synced_at":"2025-04-16T02:20:54.090Z","repository":{"id":165768801,"uuid":"196814391","full_name":"chenshen03/MarginHash-pytorch","owner":"chenshen03","description":"Pytorch implementation of Margin-based Hashing model","archived":false,"fork":false,"pushed_at":"2019-08-05T12:30:15.000Z","size":5869,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-29T04:05:23.148Z","etag":null,"topics":["computer-vision","deep-learning","hash","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenshen03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-07-14T08:53:25.000Z","updated_at":"2023-07-13T22:07:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"f13174cb-7e13-47a7-8115-b982d2c2448c","html_url":"https://github.com/chenshen03/MarginHash-pytorch","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/chenshen03%2FMarginHash-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenshen03%2FMarginHash-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenshen03%2FMarginHash-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenshen03%2FMarginHash-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenshen03","download_url":"https://codeload.github.com/chenshen03/MarginHash-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183758,"owners_count":21226252,"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":["computer-vision","deep-learning","hash","pytorch"],"created_at":"2024-11-28T17:31:13.906Z","updated_at":"2025-04-16T02:20:54.084Z","avatar_url":"https://github.com/chenshen03.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Margin-Hash-PyTorch\nPytorch implementation of Margin Hash for Image Retrieval.\n\n## Get started\nClone this repo and run the code\n```bash\n$ git clone https://github.com/chenshen03/Classfication-Hash-pytorch\n$ cd pytorch-center-loss\n$ python main.py --eval-freq 1 --gpu 0 --save-dir log/ --plot\n```\nYou will see the following info in your terminal\n```bash\nCurrently using GPU: 0\nCreating dataset: mnist\nCreating model: cnn\n==\u003e Epoch 1/100\nBatch 50/469     Loss 2.332793 (2.557837) XentLoss 2.332744 (2.388296) CenterLoss 0.000048 (0.169540)\nBatch 100/469    Loss 2.354638 (2.463851) XentLoss 2.354637 (2.379078) CenterLoss 0.000001 (0.084773)\nBatch 150/469    Loss 2.361732 (2.434477) XentLoss 2.361732 (2.377962) CenterLoss 0.000000 (0.056515)\nBatch 200/469    Loss 2.336701 (2.417842) XentLoss 2.336700 (2.375455) CenterLoss 0.000001 (0.042386)\nBatch 250/469    Loss 2.404814 (2.407015) XentLoss 2.404813 (2.373106) CenterLoss 0.000001 (0.033909)\nBatch 300/469    Loss 2.338753 (2.398546) XentLoss 2.338752 (2.370288) CenterLoss 0.000001 (0.028258)\nBatch 350/469    Loss 2.367068 (2.390672) XentLoss 2.367059 (2.366450) CenterLoss 0.000009 (0.024221)\nBatch 400/469    Loss 2.344178 (2.384820) XentLoss 2.344142 (2.363620) CenterLoss 0.000036 (0.021199)\nBatch 450/469    Loss 2.329708 (2.379460) XentLoss 2.329661 (2.360611) CenterLoss 0.000047 (0.018848)\n==\u003e Test\nAccuracy (%): 10.32  Error rate (%): 89.68\n... ...\n==\u003e Epoch 30/100\nBatch 50/469     Loss 0.141117 (0.155986) XentLoss 0.084169 (0.091617) CenterLoss 0.056949 (0.064369)\nBatch 100/469    Loss 0.138201 (0.151291) XentLoss 0.089146 (0.092839) CenterLoss 0.049055 (0.058452)\nBatch 150/469    Loss 0.151055 (0.151985) XentLoss 0.090816 (0.092405) CenterLoss 0.060239 (0.059580)\nBatch 200/469    Loss 0.150803 (0.153333) XentLoss 0.092857 (0.092156) CenterLoss 0.057946 (0.061176)\nBatch 250/469    Loss 0.162954 (0.154971) XentLoss 0.094889 (0.092099) CenterLoss 0.068065 (0.062872)\nBatch 300/469    Loss 0.162895 (0.156038) XentLoss 0.093100 (0.092034) CenterLoss 0.069795 (0.064004)\nBatch 350/469    Loss 0.146187 (0.156491) XentLoss 0.082508 (0.091787) CenterLoss 0.063679 (0.064704)\nBatch 400/469    Loss 0.171533 (0.157390) XentLoss 0.092526 (0.091674) CenterLoss 0.079007 (0.065716)\nBatch 450/469    Loss 0.209196 (0.158371) XentLoss 0.098388 (0.091560) CenterLoss 0.110808 (0.066811)\n==\u003e Test\nAccuracy (%): 98.51  Error rate (%): 1.49\n... ...\n```\n\nPlease run `python main.py -h` for more details regarding input arguments.\n\n## Results\nWe visualize the feature learning process below.\n\nSoftmax only. Left: training set. Right: test set.\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/softmax_train.gif\" alt=\"train\" width=\"30%\"\u003e\n  \u003cimg src=\"assets/softmax_test.gif\" alt=\"train\" width=\"30%\"\u003e\n\u003c/div\u003e\n\nSoftmax + center loss. Left: training set. Right: test set.\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/center_train.gif\" alt=\"train\" width=\"30%\"\u003e\n  \u003cimg src=\"assets/center_test.gif\" alt=\"train\" width=\"30%\"\u003e\n\u003c/div\u003e\n\n# Reference\n1. [KaiyangZhou/pytorch-center-loss](https://github.com/KaiyangZhou/pytorch-center-loss)\n2. [wujiyang/Face_Pytorch](https://github.com/wujiyang/Face_Pytorch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenshen03%2Fmarginhash-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenshen03%2Fmarginhash-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenshen03%2Fmarginhash-pytorch/lists"}