{"id":16916796,"url":"https://github.com/ternaus/boost_imagenet","last_synced_at":"2026-05-16T20:34:13.874Z","repository":{"id":87572833,"uuid":"541743837","full_name":"ternaus/boost_imagenet","owner":"ternaus","description":"Example on how to fine tune models to boost the performance of models on ImageNet","archived":false,"fork":false,"pushed_at":"2022-09-28T21:55:36.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T21:43:57.143Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ternaus.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":"2022-09-26T19:09:18.000Z","updated_at":"2022-09-27T00:13:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8797d57-54d9-4922-b3c3-d6020ca8369b","html_url":"https://github.com/ternaus/boost_imagenet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ternaus/boost_imagenet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ternaus%2Fboost_imagenet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ternaus%2Fboost_imagenet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ternaus%2Fboost_imagenet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ternaus%2Fboost_imagenet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ternaus","download_url":"https://codeload.github.com/ternaus/boost_imagenet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ternaus%2Fboost_imagenet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33117888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-13T19:29:54.284Z","updated_at":"2026-05-16T20:34:13.852Z","avatar_url":"https://github.com/ternaus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boost Imagenet\n\nAn example code for using [Ternaus.com](https://ternaus.com) for improving the performance of a neural network on\nthe ImageNet dataset.\n\n### Save the model\n\n```bash\nimport timm\nimport torch\n\nmodel = timm.create_model('resnet34', pretrained=True)\ntorch.jit.save(m, MODEL_SCHECKPOINT_FILE)\n```\n\n### Evaluate on the validations set\n\n```bash\npython -m src.evaluate -i PATH_TO_IMAGENET_VAL \\\n                       -r PATH_TO_REAL_JSON \\\n                       -c PATH_TO_CHECKPOINT \\\n                       -o vanila.json\n```\n\nand outputs file like:\n\n```bash\n{\n    \"accuracy\": {\n        \"1\": 81.82206375301578,\n        \"5\": 95.0765420500886\n    },\n    \"losses\": [\n        {\n            \"filename\": \"ILSVRC2012_val_00000002.JPEG\",\n            \"loss\": 0.08855907618999481\n        },\n        {\n            \"filename\": \"ILSVRC2012_val_00000003.JPEG\",\n            \"loss\": 0.00010000000000000009\n        }\n        ]\n}\n\n```\n\n### Get images that are similar to the hard ones\nGet token at [Ternaus.com/account](https://ternaus.com/account)\n\n#### Get urls to similar images:\n\n```bash\npython -m src.get_similar_images -i PATH_TO_JSON_WITH_LOSSES \\\n                                 -o OUTPUT_PATH_TO_JSON_FOR_SIMILAR_IMAGES \\\n                                 -im PATH_TO_VAL_IMAGES \\\n                                 --num_images NUM_SIMILAR_IMAGES_PER_IMAGE\n```\n\n#### Download images:\n\n```bash\npython -m src.download_images \\\n       -a PATH_TOIMAGENET_VAL_ANNOTATIONS \\\n       -u OUTPUT_PATH_TO_JSON_FOR_SIMILAR_IMAGES \\\n       -o OUTPUT_PATH \\\n       -j NUM_JOBS\n```\n\nIt creates a folder structure like:\n\n```bash\nn12985857\nn12985857.txt\nn12998815\nn12998815.txt\n```\n\nwhere `n12985857` is a folder with images and `n12985857.txt` is a file with urls to images.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fternaus%2Fboost_imagenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fternaus%2Fboost_imagenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fternaus%2Fboost_imagenet/lists"}