Codebase analysis: fix 5 runtime bugs and create missing src/data package - #1
Draft
Krishna-Modi12 with Copilot wants to merge 2 commits into
Draft
Codebase analysis: fix 5 runtime bugs and create missing src/data package#1Krishna-Modi12 with Copilot wants to merge 2 commits into
Krishna-Modi12 with Copilot wants to merge 2 commits into
Conversation
…base analysis Co-authored-by: Krishna-Modi12 <178945358+Krishna-Modi12@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze the entire codebase for improvements
Codebase analysis: fix 5 runtime bugs and create missing src/data package
Mar 8, 2026
Owner
|
Fixed |
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.
Full analysis of the Face Analysis AI V6 codebase. Found and fixed 5 bugs that would cause crashes or silent training failures, plus created a missing module that made every main entry point unrunnable.
Bugs Fixed
Critical:
src/data/package missing (ModuleNotFoundError)predict.py,eval_multitask_proper.py,train_multitask_v3.py, andscripts/debug_predictions_v2.pyall import fromsrc.data.dataset— the package simply didn't exist. Createdsrc/data/dataset.pywith:FaceAnalysisDataset— multi-task dataset reading thebuild_multitask_annotations.pyJSON format (shape, eye, brow, lip, age, gender, landmarks, Monk skin scale)extract_hsv_histogram_np— normalised 48-dim HSV histogram used bySkinTowerget_train_transforms/get_val_transformsAlso fixed
.gitignore—data/glob was suppressing the newsrc/data/source package.Critical:
SkinTowercalled with wrong arity (TypeError)train_multitask_v3.pycalledself.model.skin_tone_head(detached_features)butSkinTower.forwardrequires(bb_features, hsv_histogram):High:
skin_tone_headexcluded from optimizer param groupsget_optimizer_param_groups()inFaceAnalysisModellisted every head exceptskin_tone_head, so its weights never received gradient updates when usingFaceAnalysisLightningModule. Addedlist(self.skin_tone_head.parameters())tohead_params.High: Wrong
LOSS_WEIGHTSkey names inMultiTaskLoss(KeyError)losses.pylooked upweights['shape'],weights['features'],weights['skin']butLOSS_WEIGHTSinconfig.pyusesface_shape_weight,features_weight,skin_tone_weight.Low: Dead computation in
FaceAnalysisModel.forward()fused = self._get_fused_features(features, geometric_ratios)was computed on every forward pass and immediately discarded — the face shape head calls it internally. Removed.Documentation
Added
CODEBASE_ANALYSIS.mdcovering architecture (all 14 prediction heads, data flow, training phases), dataset sources, all bugs found, performance benchmarks, and known remaining limitations.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.