Merge/feat path b vit l classifier#4
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR: evaluate.py / path A notebook / TTA + WBF
There was a problem hiding this comment.
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.ipynbwith 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.
| "id": "6b81a1c9", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ |
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)" |
| "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", |
| "\n", | ||
| "EXTERNAL_DIR = WORKSPACE / 'external_datasets'\n", | ||
| "TACO_DIR = WORKSPACE / 'TACO'\n", | ||
| "PROCESSED_DIR = WORKSPACE / 'processed_5cls'\n", |
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 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), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.