Skip to content

Merge/feat path b vit l classifier#4

Merged
gabrafo merged 40 commits into
mainfrom
merge/feat-path-b-vit-l-classifier
May 16, 2026
Merged

Merge/feat path b vit l classifier#4
gabrafo merged 40 commits into
mainfrom
merge/feat-path-b-vit-l-classifier

Conversation

@gabrafo
Copy link
Copy Markdown
Collaborator

@gabrafo gabrafo commented May 13, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 13, 2026 12:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a ViT-L/16 (ImageNet-21k pretrained) variant to the Path B classifier registry and introduces a new RunPod-oriented Jupyter notebook to drive Path B training and evaluation against this larger model.

Changes:

  • Register vit_l16_imagenet (vit_large_patch16_224.augreg_in21k_ft_in1k, pretrained=True) in the Path B classifier dict.
  • Add notebooks/pathB.ipynb with environment paths, GPU detection, detector-weights selection, training command for the ViT-L classifier, summary, and metrics inspection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
train/paths/train_path_B.py Adds ViT-L/16 ImageNet-21k entry to the classifier registry.
notebooks/pathB.ipynb New notebook to run/inspect Path B training of the ViT-L classifier on RunPod.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread notebooks/pathB.ipynb
"id": "6b81a1c9",
"metadata": {},
"outputs": [],
"source": [
Comment thread notebooks/pathB.ipynb
Comment on lines +354 to +362
"metrics_path = RUNS_PATH_B_DIR / \"vit_l16_imagenet\" / \"metrics.json\"\n",
"\n",
"if metrics_path.exists():\n",
" with open(metrics_path) as f:\n",
" metrics = json.load(f)\n",
"\n",
" display(pd.DataFrame([metrics]).T.rename(columns={0: \"value\"}))\n",
"else:\n",
" print(\"metrics.json ainda não encontrado:\", metrics_path)"
Comment thread notebooks/pathB.ipynb
"print('EXTERNAL_DIR =', EXTERNAL_DIR)\n",
"print('PROCESSED_DIR =', PROCESSED_DIR)\n",
"print('DATASET_YAML_PATH_A=', DATASET_YAML_PATH_A)\n",
"print('DATASET_YAML_PATH_B=', DATASET_YAML_PATH_B)\n",
Comment thread notebooks/pathB.ipynb
"\n",
"EXTERNAL_DIR = WORKSPACE / 'external_datasets'\n",
"TACO_DIR = WORKSPACE / 'TACO'\n",
"PROCESSED_DIR = WORKSPACE / 'processed_5cls'\n",
Comment thread notebooks/pathB.ipynb
Comment on lines +236 to +248
"outputs": [
{
"ename": "NameError",
"evalue": "name 'PROCESSED_DIR' is not defined",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m split \u001b[38;5;28;01min\u001b[39;00m [\u001b[33m\"train\"\u001b[39m, \u001b[33m\"val\"\u001b[39m, \u001b[33m\"test\"\u001b[39m]:\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m path_b_dir = PROCESSED_DIR / split / \u001b[33m\"path_B\"\u001b[39m\n\u001b[32m 3\u001b[39m print(split, path_b_dir, \u001b[33m\"->\"\u001b[39m, path_b_dir.exists())\n\u001b[32m 4\u001b[39m \n\u001b[32m 5\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m sub \u001b[38;5;28;01min\u001b[39;00m [\u001b[33m\"images\"\u001b[39m, \u001b[33m\"labels\"\u001b[39m, \u001b[33m\"crops\"\u001b[39m]:\n",
"\u001b[31mNameError\u001b[39m: name 'PROCESSED_DIR' is not defined"
]
}
],
Comment thread notebooks/pathB.ipynb
Comment on lines +215 to +218
"DETECTOR_WEIGHTS = detector_candidates[0]\n",
"\n",
"if not DETECTOR_WEIGHTS.exists():\n",
" raise FileNotFoundError(f\"Detector não encontrado: {DETECTOR_WEIGHTS}\")\n",
# B3: ViT-B/16 ImageNet21k pretrained — large-scale pretraining value
"vit_b16_imagenet": ("vit_base_patch16_224.augreg_in21k_ft_in1k", True),
# B4: ViT-L/16 ImageNet21k pretrained — larger model with large-scale pretraining
"vit_l16_imagenet": ("vit_large_patch16_224.augreg_in21k_ft_in1k", True),
@gabrafo gabrafo merged commit 314b33a into main May 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants