{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/few-shot-object-counting-and-detection","title":"Few-shot Object Counting and Detection","arxiv_id":"2207.10988","date":"2022-07-22","proceeding":null,"authors":["Thanh Nguyen","Chau Pham","Khoi Nguyen","Minh Hoai"],"abstract":"We tackle a new task of few-shot object counting and detection. Given a few exemplar bounding boxes of a target object class, we seek to count and detect all objects of the target class. This task shares the same supervision as the few-shot object counting but additionally outputs the object bounding boxes along with the total object count. To address this challenging problem, we introduce a novel two-stage training strategy and a novel uncertainty-aware few-shot object detector: Counting-DETR. The former is aimed at generating pseudo ground-truth bounding boxes to train the latter. The latter leverages the pseudo ground-truth provided by the former but takes the necessary steps to account for the imperfection of pseudo ground-truth. To validate the performance of our method on the new task, we introduce two new datasets named FSCD-147 and FSCD-LVIS. Both datasets contain images with complex scenes, multiple object classes per image, and a huge variation in object shapes, sizes, and appearance. Our proposed approach outperforms very strong baselines adapted from few-shot object counting and few-shot object detection with a large margin in both counting and detection metrics. The code and models are available at https://github.com/VinAIResearch/Counting-DETR.","url_abs":"https://arxiv.org/abs/2207.10988v2","url_pdf":"https://arxiv.org/pdf/2207.10988v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"few-shot-object-counting-and-detection","repo_url":"https://github.com/vinairesearch/counting-detr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[{"task_slug":"few-shot-object-detection","task_name":"Few-Shot Object Detection"},{"task_slug":"few-shot-object-counting-and-detection","task_name":"Few-shot Object Counting and Detection"},{"task_slug":"object","task_name":"Object"},{"task_slug":"object-counting","task_name":"Object Counting"},{"task_slug":"object-detection","task_name":"Object Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/few-shot-object-counting-and-detection-on","task":"Few-shot Object Counting and Detection","dataset":"FSC147","model":"Counting-DETR","rank_in_archive_order":4,"of":4,"metrics":{"AP(test)":"22.66","AP50(test)":"50.57","MAE(test)":"16.79","RMSE(test)":"123.56"},"uses_additional_data":false},{"leaderboard":"/sota/object-counting-on-fsc147","task":"Object Counting","dataset":"FSC147","model":"Counting-DETR","rank_in_archive_order":16,"of":19,"metrics":{"MAE(test)":"16.79","RMSE(test)":"123.56"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.10988","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.10988"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vinairesearch/counting-detr","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/VinAIResearch/Counting-DETR","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"14e8dbf043b639ef","entry":"addmm_flop_jit","repo":"VinAIResearch/Counting-DETR","repo_kind":"official","path":"src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","file_url":"https://github.com/VinAIResearch/Counting-DETR/blob/HEAD/src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"14e8dbf043b639ef"}},{"code_sha256_prefix":"02f479a7ced90f58","entry":"bmm_flop_jit","repo":"VinAIResearch/Counting-DETR","repo_kind":"official","path":"src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","file_url":"https://github.com/VinAIResearch/Counting-DETR/blob/HEAD/src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"02f479a7ced90f58"}},{"code_sha256_prefix":"4c68885935dfa85d","entry":"get_shape","repo":"VinAIResearch/Counting-DETR","repo_kind":"official","path":"src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","file_url":"https://github.com/VinAIResearch/Counting-DETR/blob/HEAD/src/CountDETR_147_1st_stage/compute_flops_and_speeds.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"4c68885935dfa85d"}},{"code_sha256_prefix":"a6c12500497d66b1","entry":"intersection_over_union","repo":"VinAIResearch/Counting-DETR","repo_kind":"official","path":"src/CountDETR_147_2nd_stage/eval_all.py","file_url":"https://github.com/VinAIResearch/Counting-DETR/blob/HEAD/src/CountDETR_147_2nd_stage/eval_all.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a6c12500497d66b1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}