<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by sanatan kafle on Medium]]></title>
        <description><![CDATA[Stories by sanatan kafle on Medium]]></description>
        <link>https://medium.com/@sakafle?source=rss-d6b6d1146f78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eOToyGml981nvin5FkOTwQ.jpeg</url>
            <title>Stories by sanatan kafle on Medium</title>
            <link>https://medium.com/@sakafle?source=rss-d6b6d1146f78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:59:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sakafle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Don’t Just Prompt Your Images. Put Them on Trial.]]></title>
            <link>https://medium.com/@sakafle/dont-just-prompt-your-images-put-them-on-trial-032f76e298c0?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/032f76e298c0</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 13:43:45 GMT</pubDate>
            <atom:updated>2026-07-23T13:43:45.777Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes back I was working in a computer vision project. But the prompt engineering techniques I developed along the way were too interesting not to share. So, I’m going to go through 1 month of my learning here, using a simpler universal classification and dimension estimation.</p><p>Imagine you are have a camera fixed on a conveyor belt and need to know what the condition of the product is and the dimension of the product is, we needed a classification model and an extremely math heavy pipeline but prompting it using LLM gave a result which was good enough for my case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tsj42rNWt9eNOmaERjHzlg.png" /></figure><p>In this demo, we’ll be giving an image of an object and extracting structured JSON response with, object category, condition, size, dominant color and a confidence score. The model must not hallucinate fields or use difficult language.</p><h3>Approach 1 — The Naive Prompt</h3><p>This is where almost everyone starts. Write a few lines, throw the image at the model, ask for JSON, call it a day. My first attempt was throw it, pray it hits and it missed misserably.</p><pre>import anthropic<br>import base64<br><br>def encode_image(path):<br>    with open(path, &quot;rb&quot;) as f:<br>        return base64.b64encode(f.read()).decode()<br><br>client = anthropic.Anthropic()<br><br>def naive_analyze(image_path):<br>    image_data = encode_image(image_path)<br>    response = client.messages.create(<br>        model=&quot;claude-opus-4-5&quot;,<br>        max_tokens=512,<br>        messages=[{<br>            &quot;role&quot;: &quot;user&quot;,<br>            &quot;content&quot;: [<br>                {<br>                    &quot;type&quot;: &quot;image&quot;,<br>                    &quot;source&quot;: {<br>                        &quot;type&quot;: &quot;base64&quot;,<br>                        &quot;media_type&quot;: &quot;image/jpeg&quot;,<br>                        &quot;data&quot;: image_data,<br>                    },<br>                },<br>                {<br>                    &quot;type&quot;: &quot;text&quot;,<br>                    &quot;text&quot;: &quot;&quot;&quot;Analyze this image and return JSON with:<br>- category: what the object is<br>- condition: its quality or state<br>- length_estimate: approximate size<br>- color: dominant color<br>- confidence: 0-1 score<br>Return only valid JSON.&quot;&quot;&quot;<br>                }<br>            ],<br>        }]<br>    )<br>    return response.content[0].text</pre><p><strong>What I got back</strong> <em>(image of a banana on a white surface — 52% accuracy)</em></p><pre>{<br>  &quot;category&quot;: &quot;fruit&quot;,<br>  &quot;condition&quot;: &quot;looks okay, maybe slightly ripe&quot;,<br>  &quot;length_estimate&quot;: &quot;medium-sized&quot;,<br>  &quot;color&quot;: &quot;yellowish&quot;,<br>  &quot;confidence&quot;: 0.8<br>}</pre><p><strong>Results</strong></p><ul><li>Field accuracy: 52%</li><li>Usable length estimates: 31%</li><li>Parse success rate: 65%</li></ul><p>The mistakes were obvious after the fact. I gave the AI a simple prompt, but it failed because I didn’t give it clear instructions, specific words to use, or a step-by-step way to think.</p><p>Instead of precise data, the AI gave me vague, casual descriptions. It claimed to be highly confident in answers that were completely useless to my system. “medium-sized”, “yellowish” and “looks okay, maybe slightly riped” is cute but not what i was loking for. Plus, about a third of the time, it formatted the data in a way that crashed my software.</p><p>The project didn’t fail because the AI was bad. It failed because I asked a smart tool to do a precise job without giving it a detailed instruction manual.</p><h3>Approach 2 — Chain of Thought</h3><h3>Make the model think before it answers</h3><p>With the naive run, the model was going straight to a verdict without ever looking at the image. So I stopped asking it to answer. I asked it to think, then answer.</p><p>Chain-of-thought forces the model to understand the reason and to work the problem step by step before committing.</p><ul><li><strong>Observe: </strong>raw visual description. Shape, texture, color, scale cues. No interpretation yet.</li><li><strong>Reason: </strong>domain interpretation. Category, condition, and size reasoning applied to what was observed.</li><li><strong>Conclude</strong>: the structured JSON, schema-validated against a controlled vocabulary.</li></ul><pre>COT_SYSTEM_PROMPT = &quot;&quot;&quot;You are a precise visual inspection AI for an object<br>classification and measurement pipeline.<br>When analyzing images, follow this exact reasoning process:<br>1. OBSERVE: Describe all visible features objectively. Do not interpret yet.<br>2. REASON: Use what you see to determine category, condition, and size.<br>3. CONCLUDE: Produce the final structured output only after reasoning.<br>Always wrap your thinking in &lt;thinking&gt; tags.<br>The final JSON must come AFTER &lt;/thinking&gt;.<br>Use ONLY these controlled terms:<br>- category: [&quot;fruit&quot;,&quot;vegetable&quot;,&quot;tool&quot;,&quot;package&quot;,&quot;electronic&quot;,&quot;other&quot;]<br>- condition: [&quot;pristine&quot;,&quot;good&quot;,&quot;fair&quot;,&quot;damaged&quot;,&quot;unusable&quot;]<br>- length_estimate: [&quot;small (under 5cm)&quot;,&quot;medium (5-20cm)&quot;,<br>                    &quot;large (20-50cm)&quot;,&quot;extra-large (over 50cm)&quot;]<br>- color: [&quot;red&quot;,&quot;orange&quot;,&quot;yellow&quot;,&quot;green&quot;,&quot;blue&quot;,&quot;brown&quot;,<br>          &quot;white&quot;,&quot;black&quot;,&quot;grey&quot;,&quot;purple&quot;,&quot;multi&quot;]<br>&quot;&quot;&quot;<br>COT_USER_PROMPT = &quot;&quot;&quot;&lt;thinking&gt;<br>OBSERVE: I will describe exactly what I see in the image...<br>REASON: Applying category, condition, and size reasoning...<br>CONCLUDE: Based on my analysis...<br>&lt;/thinking&gt;<br>{<br>  &quot;category&quot;: &quot;...&quot;,<br>  &quot;object_name&quot;: &quot;...&quot;,<br>  &quot;condition&quot;: &quot;...&quot;,<br>  &quot;length_estimate&quot;: &quot;...&quot;,<br>  &quot;color&quot;: &quot;...&quot;,<br>  &quot;confidence&quot;: 0.0,<br>  &quot;reasoning_summary&quot;: &quot;...&quot;<br>}<br>Analyze the provided image following this exact format.&quot;&quot;&quot;<br>def cot_analyze(image_path):<br>    image_data = encode_image(image_path)<br>    response = client.messages.create(<br>        model=&quot;claude-opus-4-5&quot;,<br>        max_tokens=1500,<br>        system=COT_SYSTEM_PROMPT,<br>        messages=[{<br>            &quot;role&quot;: &quot;user&quot;,<br>            &quot;content&quot;: [<br>                {&quot;type&quot;: &quot;image&quot;, &quot;source&quot;: {<br>                    &quot;type&quot;: &quot;base64&quot;,<br>                    &quot;media_type&quot;: &quot;image/jpeg&quot;,<br>                    &quot;data&quot;: image_data<br>                }},<br>                {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: COT_USER_PROMPT}<br>            ]<br>        }]<br>    )<br>    raw = response.content[0].text<br>    # Strip &lt;thinking&gt; block, parse remaining JSON<br>    json_part = raw.split(&quot;&lt;/thinking&gt;&quot;)[-1].strip()<br>    import json<br>    return json.loads(json_part)</pre><p><strong>CoT output</strong> <em>(same banana image — 73% accuracy)</em></p><pre>{<br>  &quot;category&quot;: &quot;fruit&quot;,<br>  &quot;object_name&quot;: &quot;banana&quot;,<br>  &quot;condition&quot;: &quot;good&quot;,<br>  &quot;length_estimate&quot;: &quot;medium (5–20cm)&quot;,<br>  &quot;color&quot;: &quot;yellow&quot;,<br>  &quot;confidence&quot;: 0.85,<br>  &quot;reasoning_summary&quot;: &quot;Curved yellow fruit, uniform skin, no blemishes. Length estimated from curvature span relative to surface texture scale.&quot;<br>}</pre><p><strong>Results:</strong></p><ul><li>Field accuracy: 73%</li><li>Usable length estimates: 81%</li><li>Parse success rate: 97%</li></ul><p><strong>The remaining problem:</strong> CoT fixed parse failures and enforced controlled vocabulary. But it was still deterministic, the same image always produced the same reasoning chain. On ambiguous images (a slightly mottled apple, a tool seen from an odd angle), one reasoning path often led to the wrong conclusion. A different framing would yield a better answer.</p><p>Chain-of-thought gave me structure. But structure alone doesn’t handle ambiguity. I needed to explore the solution space, not just navigate it more carefully in one direction.</p><h3>Interlude — Task-Specific Prompts</h3><h3>What if each field got its own dedicated prompt?</h3><p>Before trying multi-prompt, I tried to split the task into single-purpose prompts. One just for length, One just for condition and One just for the category and colour.</p><pre>TASK_PROMPTS = {<br>    &quot;length&quot;: {<br>        &quot;system&quot;: &quot;&quot;&quot;You are a size estimation specialist.<br>Your ONLY job is to estimate the size of the main object in the image.<br>Ignore condition, color, and category entirely.<br>Focus on:<br>- Aspect ratio and longest visible dimension<br>- Any reference objects (coins, hands, surface area, packaging)<br>- Perspective distortion and foreshortening cues<br>- Typical real-world dimensions of the identified object type<br>Return ONLY this JSON (no preamble, no markdown):<br>{<br>  &quot;length_estimate&quot;: &quot;small (under 5cm)&quot; | &quot;medium (5-20cm)&quot; |<br>                     &quot;large (20-50cm)&quot; | &quot;extra-large (over 50cm)&quot;,<br>  &quot;size_reasoning&quot;: &quot;one sentence explaining your estimate&quot;,<br>  &quot;confidence&quot;: 0.0<br>}&quot;&quot;&quot;,<br>        &quot;user&quot;: &quot;Estimate the size of the main object in this image.&quot;<br>    },<br>    &quot;condition&quot;: {<br>        &quot;system&quot;: &quot;&quot;&quot;You are a quality inspection specialist.<br>Your ONLY job is to assess the condition of the main object in the image.<br>Ignore size, color, and category entirely.<br>Focus on:<br>- Surface uniformity (blemishes, cracks, rust, bruising, discoloration)<br>- Structural integrity (deformation, missing parts, breaks)<br>- Cleanliness, wear, and deterioration<br>Return ONLY this JSON (no preamble, no markdown):<br>{<br>  &quot;condition&quot;: &quot;pristine&quot; | &quot;good&quot; | &quot;fair&quot; | &quot;damaged&quot; | &quot;unusable&quot;,<br>  &quot;defects_observed&quot;: [&quot;specific issue 1&quot;, &quot;specific issue 2&quot;],<br>  &quot;confidence&quot;: 0.0<br>}&quot;&quot;&quot;,<br>        &quot;user&quot;: &quot;Assess the condition of the main object in this image.&quot;<br>    },<br>    &quot;category&quot;: {<br>        &quot;system&quot;: &quot;&quot;&quot;You are an object classification specialist.<br>Your ONLY job is to identify what the main object is in the image.<br>Ignore size and condition entirely.<br>Focus on:<br>- Distinctive shape, silhouette, and profile<br>- Texture and material properties (metallic, organic, plastic, fabric)<br>- Any visible text, logos, or branding<br>- Contextual clues from the background and surroundings<br>Return ONLY this JSON (no preamble, no markdown):<br>{<br>  &quot;category&quot;: &quot;fruit&quot; | &quot;vegetable&quot; | &quot;tool&quot; | &quot;package&quot; |<br>               &quot;electronic&quot; | &quot;other&quot;,<br>  &quot;object_name&quot;: &quot;specific common name&quot;,<br>  &quot;color&quot;: &quot;red&quot;|&quot;orange&quot;|&quot;yellow&quot;|&quot;green&quot;|&quot;blue&quot;|&quot;brown&quot;|<br>            &quot;white&quot;|&quot;black&quot;|&quot;grey&quot;|&quot;purple&quot;|&quot;multi&quot;,<br>  &quot;confidence&quot;: 0.0<br>}&quot;&quot;&quot;,<br>        &quot;user&quot;: &quot;Identify the main object in this image.&quot;<br>    }<br>}</pre><pre>def task_specific_analyze(image_path):<br>    &quot;&quot;&quot;Run one dedicated prompt per attribute, merge results.&quot;&quot;&quot;<br>    image_data = encode_image(image_path)<br>    results = {}<br>    for task_name, prompts in TASK_PROMPTS.items():<br>        response = client.messages.create(<br>            model=&quot;claude-opus-4-5&quot;,<br>            max_tokens=400,<br>            system=prompts[&quot;system&quot;],<br>            messages=[{<br>                &quot;role&quot;: &quot;user&quot;,<br>                &quot;content&quot;: [<br>                    {&quot;type&quot;: &quot;image&quot;, &quot;source&quot;: {<br>                        &quot;type&quot;: &quot;base64&quot;,<br>                        &quot;media_type&quot;: &quot;image/jpeg&quot;,<br>                        &quot;data&quot;: image_data<br>                    }},<br>                    {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: prompts[&quot;user&quot;]}<br>                ]<br>            }]<br>        )<br>        import json<br>        results[task_name] = json.loads(response.content[0].text)<br>    return {<br>        &quot;category&quot;:         results[&quot;category&quot;][&quot;category&quot;],<br>        &quot;object_name&quot;:      results[&quot;category&quot;][&quot;object_name&quot;],<br>        &quot;color&quot;:            results[&quot;category&quot;][&quot;color&quot;],<br>        &quot;condition&quot;:        results[&quot;condition&quot;][&quot;condition&quot;],<br>        &quot;defects&quot;:          results[&quot;condition&quot;][&quot;defects_observed&quot;],<br>        &quot;length_estimate&quot;:  results[&quot;length&quot;][&quot;length_estimate&quot;],<br>        &quot;size_reasoning&quot;:   results[&quot;length&quot;][&quot;size_reasoning&quot;],<br>        &quot;_task_confidences&quot;: {<br>            t: results[t][&quot;confidence&quot;] for t in results<br>        }<br>    }</pre><blockquote><strong>What each task prompt returned</strong> <em>(same ambiguous mango image)</em></blockquote><p>Length prompt only — Confidence: 0.62</p><pre>{<br>  &quot;length_estimate&quot;: &quot;medium (5–20cm)&quot;,<br>  &quot;size_reasoning&quot;: &quot;Oval drupe occupying roughly 60% of frame width; no reference object visible, estimated from typical mango dimensions and apparent perspective.&quot;,<br>  &quot;confidence&quot;: 0.62<br>}</pre><p>Condition prompt only — Confidence: 0.91</p><pre>{<br>  &quot;condition&quot;: &quot;damaged&quot;,<br>  &quot;defects_observed&quot;: [<br>    &quot;dark brown-black bruising on upper-left quadrant&quot;,<br>    &quot;approximately 25–30% of surface area affected&quot;,<br>    &quot;skin integrity compromised at bruised region&quot;<br>  ],<br>  &quot;confidence&quot;: 0.91<br>}</pre><p>Category prompt only — Confidence: 0.94</p><pre>{<br>  &quot;category&quot;: &quot;fruit&quot;,<br>  &quot;object_name&quot;: &quot;mango&quot;,<br>  &quot;color&quot;: &quot;orange&quot;,<br>  &quot;confidence&quot;: 0.94<br>}</pre><p><strong>Results:</strong></p><ul><li>Overall field accuracy: 79%</li><li>Usable length estimates: 63%</li><li>Parse success rate: 99%</li></ul><p><strong>Result Obtained</strong></p><p>Task isolation helped with condition and category but length estimation didn’t improve. It did give me a per-field confidence score which will help me flag exactly what we can be good at and what should be flagged.</p><h3>Approach 3 — Multi-Prompt Sampling</h3><h3>Generate multiple answers, then pick the best one</h3><p>For visually ambigous inputs, there isn’t always one correct path to choose from. Different prompt framings activate different parts of the model’s knowledge. So, I started three prompts in parallel, each with a disti reasoning.</p><pre>PROMPT_STRATEGIES = {<br>    &quot;shape_and_size&quot;: &quot;&quot;&quot;Focus primarily on geometry and size estimation.<br>Look for: aspect ratio, curvature, reference objects in frame, shadow<br>size, perspective foreshortening, and any visible scale markers.<br>Ask yourself: What is the approximate span from end to end?<br>After detailed size reasoning, produce the JSON.&quot;&quot;&quot;,<br>&quot;condition_and_color&quot;: &quot;&quot;&quot;Focus primarily on surface condition and color.<br>Look for: uniformity of color, blemishes, bruising, rust, wear marks,<br>cracks, moisture, discoloration, or deformation.<br>Ask yourself: Would this pass a quality inspection?<br>After detailed condition reasoning, produce the JSON.&quot;&quot;&quot;,<br>    &quot;category_and_identity&quot;: &quot;&quot;&quot;Focus primarily on identifying what the object is.<br>Look for: distinctive shape, texture patterns, visible text or logos,<br>material properties (matte, glossy, rough, smooth), context clues.<br>Ask yourself: What is the most specific correct category?<br>After detailed classification reasoning, produce the JSON.&quot;&quot;&quot;<br>}<br>def multi_prompt_analyze(image_path):<br>    image_data = encode_image(image_path)<br>    candidates = []<br>    for name, strategy in PROMPT_STRATEGIES.items():<br>        prompt = f&quot;&quot;&quot;&lt;thinking&gt;<br>{strategy}<br>&lt;/thinking&gt;<br>Now produce structured JSON: category, object_name, condition,<br>length_estimate, color, confidence (0-1), reasoning_summary.&quot;&quot;&quot;<br>        response = client.messages.create(<br>            model=&quot;claude-opus-4-5&quot;,<br>            max_tokens=1500,<br>            system=COT_SYSTEM_PROMPT,<br>            messages=[{<br>                &quot;role&quot;: &quot;user&quot;,<br>                &quot;content&quot;: [<br>                    {&quot;type&quot;: &quot;image&quot;, &quot;source&quot;: {<br>                        &quot;type&quot;: &quot;base64&quot;,<br>                        &quot;media_type&quot;: &quot;image/jpeg&quot;,<br>                        &quot;data&quot;: image_data<br>                    }},<br>                    {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: prompt}<br>                ]<br>            }]<br>        )<br>        raw = response.content[0].text<br>        json_part = raw.split(&quot;&lt;/thinking&gt;&quot;)[-1].strip()<br>        import json<br>        result = json.loads(json_part)<br>        result[&quot;_strategy&quot;] = name<br>        candidates.append(result)<br>    return candidates</pre><p><strong>Three candidates, three genuinely different answers</strong> <em>(ambiguous overripe mango)</em></p><p>Candidate A — Shape &amp; size lens: condition: &quot;fair&quot;, length_estimate: &quot;medium (5–20cm)&quot;, confidence: 0.71</p><p>Candidate B — Condition &amp; color lens <em>(closest to ground truth)</em>: condition: &quot;damaged&quot;, length_estimate: &quot;medium (5–20cm)&quot;, confidence: 0.88</p><p>Candidate C — Category &amp; identity lens: condition: &quot;fair&quot;, length_estimate: &quot;small (under 5cm)&quot;, confidence: 0.65</p><p>Candidate B was closest to the ground truth but choosing blindly the highest-confidence result, I needed something smarter than a confidence vote</p><h3>Approach 4 — LLM-as-Judge Evaluator</h3><h3>Let an LLM decide which answer is best</h3><p>So, everything was in place, results were converging, but a trust worthy candidate was to be choosen. An evaluator LLM that received all the candidate answers along with the original image that selects the best answer based on consistency and reasoning quality.</p><p>Rather than using a heuristic scoring, you let a model assess candidates the same way a senior reviewer looks at junior assignments.</p><pre>EVALUATOR_SYSTEM = &quot;&quot;&quot;You are a quality auditor reviewing candidate outputs<br>from a visual classification and measurement pipeline.Evaluate each candidate on five dimensions:<br>1. Visual plausibility  - Does the classification match what the image shows?<br>2. Internal consistency - Do all fields agree with each other?<br>3. Vocabulary compliance - Are controlled terms used correctly?<br>4. Length estimate plausibility - Does the size claim make sense?<br>5. Confidence calibration - Is the stated confidence realistic?<br>Score each 1-5. Return a JSON object with:<br>- scores: { candidateA: {...}, candidateB: {...}, candidateC: {...} }<br>- best_candidate: &quot;A&quot; | &quot;B&quot; | &quot;C&quot;<br>- reasoning: &quot;...&quot; (one paragraph explaining the choice)<br>- final_answer: { ...best candidate JSON, lightly corrected if needed... }<br>&quot;&quot;&quot;<br>def evaluate_candidates(image_path, candidates):<br>    image_data = encode_image(image_path)<br>    import json<br>    candidates_text = json.dumps({<br>        &quot;candidateA&quot;: candidates[0],<br>        &quot;candidateB&quot;: candidates[1],<br>        &quot;candidateC&quot;: candidates[2]<br>    }, indent=2)<br>    eval_prompt = f&quot;&quot;&quot;Three candidate analyses of the provided image.<br>Evaluate them using the scoring rubric, return decision as JSON.<br>CANDIDATES:<br>{candidates_text}&quot;&quot;&quot;<br>    response = client.messages.create(<br>        model=&quot;claude-opus-4-5&quot;,<br>        max_tokens=2000,<br>        system=EVALUATOR_SYSTEM,<br>        messages=[{<br>            &quot;role&quot;: &quot;user&quot;,<br>            &quot;content&quot;: [<br>                {&quot;type&quot;: &quot;image&quot;, &quot;source&quot;: {<br>                    &quot;type&quot;: &quot;base64&quot;,<br>                    &quot;media_type&quot;: &quot;image/jpeg&quot;,<br>                    &quot;data&quot;: image_data<br>                }},<br>                {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: eval_prompt}<br>            ]<br>        }]<br>    )<br>    return json.loads(response.content[0].text)<br>def full_pipeline(image_path):<br>    candidates  = multi_prompt_analyze(image_path)            # step 1<br>    evaluation  = evaluate_candidates(image_path, candidates) # step 2<br>    return {<br>        &quot;final_answer&quot;:        evaluation[&quot;final_answer&quot;],<br>        &quot;selected_strategy&quot;:   evaluation[&quot;best_candidate&quot;],<br>        &quot;evaluator_reasoning&quot;: evaluation[&quot;reasoning&quot;],<br>        &quot;candidate_scores&quot;:    evaluation[&quot;scores&quot;]<br>    }<br></pre><p><strong>Results:</strong></p><ul><li>Field accuracy: 91%</li><li>Usable length estimates: 94%</li><li>Parse success rate: 99%</li></ul><p>What this layer added was reasoning the confidence and answers from candidates. It chose lower-condifence candidates because of how some prompts reasoned the conditions. It basically looks what it is saying rather than beleiving the numerical result from the candidates.</p><h3>All Approaches Compared</h3><h4>1. Naive Single Prompt</h4><ul><li><strong>Accuracy:</strong> 52% | <strong>Parse Rate:</strong> 65% | <strong>Cost:</strong> 1×</li><li><strong>Best for:</strong> Rapid prototyping only</li></ul><h4>2. Chain of Thought</h4><ul><li><strong>Accuracy:</strong> 73% | <strong>Parse Rate:</strong> 97% | <strong>Cost:</strong> 1.5×</li><li><strong>Best for:</strong> Clear, unambiguous images</li></ul><h4>3. Task-Specific Prompts</h4><ul><li><strong>Accuracy:</strong> 79% | <strong>Parse Rate:</strong> 99% | <strong>Cost:</strong> 3×</li><li><strong>Best for:</strong> Per-field confidence routing</li></ul><h4>4. Multi-Prompt (No Eval)</h4><ul><li><strong>Accuracy:</strong> 78% | <strong>Parse Rate:</strong> 99% | <strong>Cost:</strong> 4×</li><li><strong>Best for:</strong> Ambiguous inputs, manual review</li></ul><h4>5. Multi-Prompt + LLM Judge</h4><ul><li><strong>Accuracy:</strong> 91% | <strong>Parse Rate:</strong> 99% | <strong>Cost:</strong> 5.5×</li><li><strong>Best for:</strong> Production, high-accuracy requirements</li></ul><h3>Five Lessons From the Trenches</h3><ol><li><strong>Controlled vocabulary is the highest-ROI improvement</strong></li></ol><p>Vocabulary constraints goes a long way. Explicitly asking the LLM to give a certain format of text for example, ‘Yellowish’ becomes ‘yellow’ and ‘Medium-sized’ becomes ‘medium (5–20 cm)’.</p><p><strong>2. Incase of LLM, Uncertainty is information and not a bug</strong></p><p>When a model outputs “possibly fair, maybe good” for a condition field, it’s telling you something that this image is genuinely ambiguous. Rather than re-prompting it to be more decisive, treat it as a trigger for another prompt or LLM.</p><p><strong>3. Provide grounding to evaluator LLM</strong></p><p>Rather than asking evaluator to pick the best answer, ask it to select based on certain criteria and dimensions. A judge is only as good as its scoring criteria.</p><p><strong>4. Length estimation is hard, and under-appreciated</strong></p><p>Length estimation without any reference object, models guess from category identity was really stubborn. So, use it as a cue rather than a definative answer, not only in length in such vague and ambigious stuffs.</p><p><strong>5. Build your eval suite before you start iterating</strong></p><p>I wasted two weeks making prompt changes and eyeballing results. The moment I built a proper test set with ground-truth labels and a consistent accuracy metric, progress became visible and directional. Measure first. Then iterate.</p><h3>Wrapping Up</h3><p>I started with a one-liner prompt that produced vague, unparseable JSON. Ending with multi-stage pipeline that generated different reasonings and domain based answers is where the real architecrural map steps in and difference between engineering and asking is visible.</p><p>The naive approach showed me what ‘bad’ looked like while chain-of-thought told me why. Multi-prompt showed that ambiguity is exploitable and LLM showed me how quality can be assessed. At the end of the day, the goal isn’t using the most sophisticated prompt rather the most accurate architecture for your usecase.</p><p><strong><em>All code examples use the Anthropic Python SDK. The underlying project is confidential — all examples here use simplified, publicly shareable tasks that demonstrate the same techniques.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=032f76e298c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step: Reducing Depth Map API Latency by 90% using FastAPI]]></title>
            <link>https://medium.com/@sakafle/handling-heavy-payloads-best-practices-for-image-depth-map-apis-0b27b8d0492f?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b27b8d0492f</guid>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 01:16:56 GMT</pubDate>
            <atom:updated>2026-02-21T01:23:29.682Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I had to work on a project where i had to send depth map in response to the flutter team for visualization.</p><blockquote>Depth maps are a 2D array that represents how far each pixel is from the camera. Hence, the size of the depth map is exactly what the size of the image is.</blockquote><p>The issue:</p><p>If my image is <strong>1920 x 1080</strong>, my depth map is also a <strong>1920 x 1080</strong> matrix of floating-point numbers. That’s around 8.3 million bytes that needs to be transmitted over the network !!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*W9dFobSbIprBmOlW9c-Bvw.png" /><figcaption>Optimization Block Diagram</figcaption></figure><h3>The “Naive” Approach:</h3><ul><li>Process the image in Python.</li><li>Encode the image and the depth array as Base64 strings.</li><li>Stuff them into a JSON response.</li><li>Send it back to the client.</li></ul><p>Let me show you what this looked like:</p><pre>import base64<br>import cv2<br>import numpy as np<br><br>def naive_approach(image, depth_array):<br>    # Encode image<br>    _, buffer = cv2.imencode(&#39;.jpg&#39;, image)<br>    img_b64 = base64.b64encode(buffer).decode(&#39;utf-8&#39;)<br>    <br>    # Encode depth map (float32 array)<br>    depth_bytes = depth_array.tobytes()<br>    depth_b64 = base64.b64encode(depth_bytes).decode(&#39;utf-8&#39;)<br>    <br>    return {<br>        &quot;image&quot;: img_b64,<br>        &quot;depthMap&quot;: depth_b64,<br>        &quot;width&quot;: 1920,<br>        &quot;height&quot;: 1080<br>    }</pre><p>For a 1920 x 1080 depth map using float32:</p><ul><li>Raw Size : 1920 x 1080 x 4 bytes = 8.29 MB</li><li>Base64 encoded: ~11.05 MB</li></ul><blockquote>Because every 3 bytes of original data turns into 4 bytes of Base64 text, the size increases by exactly 1/3rd.</blockquote><p>This cause an issue, time to get response and decode was too much.</p><h3><strong>Steps Implemented to Optimize</strong></h3><p>After the overhead issue, i started researching and talking with the team. Is it really a necessity to send the data with 32-bit precision?</p><h3>Optimization #1: Float32 → Float16 (50% Reduction)</h3><p>For depth visualization, 16-bit floating-point precision is more than sufficient. Half-precision floats can represent values from approximately -65,504 to +65,504 with decent precision.</p><pre># Load depth data with float16 instead of float32<br>depth_map = np.frombuffer(<br>    decompressed_data, <br>    dtype=np.float16  # Changed from np.float32<br>).reshape(num_frames, height, width)py</pre><p>Results:</p><ul><li>File size: 8.29 MB → 4.15 MB (50% reduction)</li><li>Processing time: Minimal change</li><li>Precision loss: Negligible for visualization</li></ul><h3>Optimization #2: Zlib Compression (70–85% Reduction)</h3><p>Next, I added compression. Zlib is perfect for numerical data because depth maps have patterns and repetitions that compress well.</p><pre>import zlib<br><br>def compress_depth_map(depth_map):<br>    # Convert to float16 bytes<br>    depth_bytes = depth_map.astype(np.float16).tobytes()<br>    <br>    # Compress with zlib<br>    compressed = zlib.compress(<br>        depth_bytes, <br>        level=6,  # Balance between speed and compression<br>        wbits=-zlib.MAX_WBITS  # Raw deflate format<br>    )<br>    <br>    return compressed<br><br>def decompress_depth_map(compressed_data, shape):<br>    # Decompress<br>    decompressed = zlib.decompress(<br>        compressed_data, <br>        wbits=-zlib.MAX_WBITS<br>    )<br>    <br>    # Reconstruct array<br>    return np.frombuffer(<br>        decompressed, <br>        dtype=np.float16<br>    ).reshape(shape)</pre><p>Results:</p><ul><li>File size: 4.15 MB → 0.62 MB (85% compression ratio)</li><li>Decompression time: ~50–100ms</li><li>Total transfer time: 5 seconds → 800ms</li></ul><h3>Optimization #3: Normalization + uint8 (87.5% Reduction from Original)</h3><p>For visualization purposes, we don’t need the absolute depth values in the response. We can normalize the depth map to 0–255 range and use 8-bit integers:</p><pre>def normalize_depth_to_uint8(depth_map):<br>    &quot;&quot;&quot;<br>    Normalize depth map to 0-255 range using percentile-based scaling<br>    to handle outliers robustly<br>    &quot;&quot;&quot;<br>    # Create mask for valid depth values<br>    valid_mask = depth_map &gt; 0<br>    <br>    if np.any(valid_mask):<br>        valid_depths = depth_map[valid_mask]<br>        # Use percentiles to ignore outliers<br>        depth_min = np.percentile(valid_depths, 2)<br>        depth_max = np.percentile(valid_depths, 98)<br>    else:<br>        depth_min = float(np.min(depth_map))<br>        depth_max = float(np.max(depth_map))<br>    <br>    # Normalize to 0-255<br>    if depth_max &gt; depth_min:<br>        normalized = ((depth_map - depth_min) / <br>                     (depth_max - depth_min) * 255)<br>        normalized = np.clip(normalized, 0, 255)<br>    else:<br>        normalized = np.zeros_like(depth_map)<br>    <br>    return normalized.astype(np.uint8), depth_min, depth_max</pre><blockquote>We send back the depth_min and depth_max values in the metadata, so the client can reconstruct the original depth values if needed</blockquote><p>Results:</p><ul><li>File size per value: 4 bytes → 1 byte (75% reduction)</li><li>Raw depth map: 8.29 MB → 2.07 MB (uncompressed uint8)</li><li>With PNG compression: ~200–400 KB (PNG is optimized for this!)</li></ul><h3>Optimization #4: PNG Encoding for Depth Maps</h3><p>Instead of sending raw binary data, encode the normalized uint8 depth map as a PNG image:</p><pre>from PIL import Image<br>import io<br><br>def encode_depth_as_png(depth_map_uint8):<br>    &quot;&quot;&quot;<br>    Encode normalized depth map as optimized PNG<br>    &quot;&quot;&quot;<br>    depth_img = Image.fromarray(depth_map_uint8)<br>    <br>    # Save to memory buffer<br>    buffer = io.BytesIO()<br>    depth_img.save(<br>        buffer, <br>        format=&quot;PNG&quot;, <br>        optimize=True  # Enable PNG optimization<br>    )<br>    <br>    return buffer.getvalue()</pre><p>Why PNG?</p><ul><li>Lossless compression perfect for depth maps</li><li>Native support in all browsers and mobile frameworks</li><li>Built-in optimization algorithms</li><li>Can be displayed directly for debugging</li></ul><p>Results:</p><ul><li>File size: ~300–500 KB (depending on scene complexity)</li><li>Total reduction: 8.29 MB → 0.4 MB (95% reduction!)</li></ul><h3>Optimization #5: Offload to S3 + Async Upload</h3><p>The final optimization: Don’t send heavy payloads in API responses at all!</p><ol><li>Upload the image and depth map to S3</li><li>Return only URLs in the API response</li><li>Use async uploads to speed things up</li></ol><pre>import concurrent.futures<br>import uuid<br>import boto3<br><br>def upload_frame_and_depth_async(frame_arr, depth_map_arr=None):<br>    &quot;&quot;&quot;<br>    Upload frame and depth map to S3 asynchronously<br>    &quot;&quot;&quot;<br>    s3_client = initialize_s3_client()<br>    unique_id = str(uuid.uuid4())<br>    <br>    # Prepare frame (RGB image)<br>    frame_rgb = cv2.cvtColor(frame_arr, cv2.COLOR_BGR2RGB)<br>    frame_img = Image.fromarray(frame_rgb)<br>    frame_buffer = io.BytesIO()<br>    frame_img.save(frame_buffer, format=&quot;PNG&quot;)<br>    <br>    # Prepare depth map<br>    depth_meta = {}<br>    if depth_map_arr is not None:<br>        # Normalize to uint8<br>        normalized_depth, depth_min, depth_max = normalize_depth_to_uint8(<br>            depth_map_arr<br>        )<br>        <br>        # Encode as PNG<br>        depth_img = Image.fromarray(normalized_depth)<br>        depth_buffer = io.BytesIO()<br>        depth_img.save(depth_buffer, format=&quot;PNG&quot;, optimize=True)<br>        <br>        depth_meta = {<br>            &quot;depthMin&quot;: float(depth_min),<br>            &quot;depthMax&quot;: float(depth_max),<br>            &quot;depthWidth&quot;: normalized_depth.shape[1],<br>            &quot;depthHeight&quot;: normalized_depth.shape[0],<br>        }<br>    <br>    # Async upload to S3<br>    with concurrent.futures.ThreadPoolExecutor() as executor:<br>        futures = []<br>        <br>        # Upload frame<br>        frame_key = f&quot;public/detection/{unique_id}_frame.png&quot;<br>        futures.append(<br>            executor.submit(<br>                upload_to_s3, <br>                s3_client, <br>                frame_buffer, <br>                bucket, <br>                frame_key, <br>                &quot;image/png&quot;<br>            )<br>        )<br>        <br>        # Upload depth map<br>        if depth_map_arr is not None:<br>            depth_key = f&quot;public/detection/{unique_id}_depth.png&quot;<br>            futures.append(<br>                executor.submit(<br>                    upload_to_s3,<br>                    s3_client,<br>                    depth_buffer,<br>                    bucket,<br>                    depth_key,<br>                    &quot;image/png&quot;<br>                )<br>            )<br>        <br>        # Wait for all uploads<br>        concurrent.futures.wait(futures)<br>    <br>    # Return URLs and metadata<br>    return {<br>        &quot;baseUrl&quot;: f&quot;https://{bucket}.s3.amazonaws.com/public/detection/&quot;,<br>        &quot;image&quot;: f&quot;{unique_id}_frame.png&quot;,<br>        &quot;depth&quot;: f&quot;{unique_id}_depth.png&quot;,<br>        **depth_meta<br>    }</pre><p>Results:</p><ul><li>API response size: 11 MB → &lt; 1 KB (JSON with URLs)</li><li>API response time: 2–5 seconds → 150–300ms</li></ul><h3>Final Performance Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*0Eyh7a_R_42-y6izyoT4lg.png" /><figcaption>Performance Comparision</figcaption></figure><h3>Key Takeaways</h3><ol><li>Choose the right data type: float16 is usually sufficient for depth maps</li><li>Compress numerical data: Zlib works wonders on depth maps</li><li>Normalize for visualization: uint8 is perfect for display purposes</li><li>Leverage image formats: PNG compression is excellent for normalized depth</li><li>Offload heavy data: Use S3/CDN, return URLs in API responses</li><li>Go async: Parallel uploads significantly reduce latency</li><li>Send metadata: Always include min/max for reconstruction</li></ol><h3>Conclusion</h3><p>What i noticed is that optimization isn’t only how you can compress data but how you represent your architecture as a whole. By combining multiple techniques:</p><ul><li>Data type optimization (float32 → float16 → uint8)</li><li>Compression (zlib, PNG)</li><li>Architecture changes (S3 offloading)</li><li>Async processing (concurrent uploads)</li></ul><p>We achieved a 99.99% reduction in API response size and 10–20x improvement in response time.</p><p>The Flutter team is now happy, users enjoy smooth experiences, and our servers handle 10x more concurrent requests. Win-win-win! 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b27b8d0492f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Compiled a Mac Command Line Tool in the Cloud Using GitHub Actions]]></title>
            <link>https://medium.com/@sakafle/how-i-compiled-a-mac-command-line-tool-in-the-cloud-using-github-actions-404959830482?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/404959830482</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 08:12:38 GMT</pubDate>
            <atom:updated>2025-12-01T06:09:14.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AzraHf8bTEoRv62hlcQnLg.png" /></figure><p>For the longest time, I believed that building a macOS-compatible command line tool <em>required</em> having a Mac. After all, macOS binaries use different architectures, different libraries, and are difficult to build from any other operating system.</p><p>But during a recent project, I found myself in a situation :</p><ul><li>I work on Linux.</li><li>My Flutter teammates work on macOS.</li><li>They needed a <strong>simple CLI tool</strong> that merges RGB videos and ZLIB depth maps without installing Python or any dependencies.</li><li>I had <strong>no physical Mac</strong> to compile a macOS binary.</li></ul><p>Buying a Mac just to build a command line tool felt unnecessary.<br> So instead, I decided to build a macOS executable <strong>completely in the cloud</strong>, using <strong>GitHub Actions</strong>.</p><p>To my surprise, the process was not only possible, it was smooth, repeatable, and far cleaner than manually building on a local machine.<br> This article walks you through exactly how I did it.</p><h3>Why I Needed a macOS CLI Tool</h3><p>My project involved combining:</p><ul><li>An RGB video</li><li>A .zlib file containing depth information</li><li>A metadata file</li></ul><p>… and generating a merged video output.</p><p>Every time a new logic was built for depth and frames, the Flutter team had to send me the file, and I had to run it in Colab which took a lot of time. Hence, a tool for them was needed.</p><p>The Flutter team wanted a <strong>single executable</strong> they could run on their Macs:</p><pre>./merge_cli input_folder</pre><p>No Python, no pip install, no extra setup.</p><p>But PyInstaller only builds macOS binaries <strong>from macOS</strong>.<br> Linux → macOS cross-compilation is not supported.</p><p>So I was stuck… unless I used a cloud macOS environment.</p><h3>Enter GitHub Actions: macOS Runners</h3><p>GitHub Actions provides CI runners for all three major operating systems:</p><ul><li><strong>Ubuntu</strong></li><li><strong>Windows</strong></li><li><strong>macOS</strong></li></ul><p>And the macOS runner comes with everything I needed:</p><ul><li>Python preinstalled</li><li>Ability to install PyInstaller</li><li>macOS-compatible compilation environment</li><li>Artifact upload support</li></ul><p>This meant I could:</p><ol><li>Push code to GitHub</li><li>Let a macOS runner build the binary</li><li>Download the generated macOS executable</li><li>Share it with my teammates</li></ol><p>All from my Linux machine.</p><h3>Project Structure</h3><p>My project looked like this:</p><pre>merge_tool/<br>│── merger/<br>│     └── merge_logic.py<br>│── merge_cli.py<br>│── requirements.txt<br>│── merge_cli.spec   (optional)<br>│── build.sh         (optional)</pre><h3>merge_tool/</h3><p>This is the <strong>root folder</strong> of your project. All project files and subfolders live under this directory.</p><h3>merger/</h3><p>This is a <strong>subfolder</strong> that contains the core logic for merging your RGB videos with depth maps.</p><ul><li><strong>merge_logic.py</strong></li><li>This file contains the actual <strong>Python code that implements the merging logic</strong>.</li><li>It has functions that take in an RGB video, a .zlib depth map, and metadata, and outputs the merged video.</li></ul><h3>merge_cli.py</h3><ul><li>This is the <strong>entry point for the command-line tool</strong>.</li><li>When you run ./merge_cli input_folder, this script is executed.</li></ul><ol><li>Parses command-line arguments.</li><li>Calls the functions from merge_logic.py.</li><li>Handles user interaction, logging, or error messages.</li></ol><p>Think of merge_cli.py as the “interface” between the user and your core logic in merge_logic.py.</p><h3>requirements.txt</h3><ul><li>This file lists <strong>all Python dependencies</strong> your project needs.</li></ul><h3>The GitHub Actions Workflow (macOS Build)</h3><p>Inside .github/workflows/build_macos.yml, I added:</p><pre>name: Build merge_cli macOS<br><br>on:<br>  push:<br>    branches: [ master ]<br>  workflow_dispatch:<br><br>jobs:<br>  build-macos:<br>    runs-on: macos-latest<br><br>    steps:<br>      - name: Checkout repo<br>        uses: actions/checkout@v4<br><br>      - name: Setup Python<br>        uses: actions/setup-python@v5<br>        with:<br>          python-version: &#39;3.11&#39;<br><br>      - name: Install dependencies<br>        run: |<br>          python -m pip install --upgrade pip<br>          pip install -r requirements.txt<br>          pip install pyinstaller<br><br>      - name: Build macOS binary<br>        run: |<br>          pyinstaller --onefile merge_cli.py<br><br>      - name: Upload artifact<br>        uses: actions/upload-artifact@v4<br>        with:<br>          name: merge-cli-macos<br>          path: dist/merge_cli</pre><h3>What this workflow does</h3><p>✔ Checks out the repo<br> ✔ Installs Python + dependencies<br> ✔ Runs PyInstaller in a real macOS environment<br> ✔ Uploads the macOS binary as a downloadable artifact</p><p>Every time I pushed to the master branch, GitHub automatically rebuilt the macOS binary.</p><p>Once a workflow run finishes:</p><ol><li>Go to <strong>GitHub → Actions</strong></li><li>Select your latest workflow run</li><li>Scroll to <strong>Artifacts</strong></li><li>Download merge-cli-macos.zip</li></ol><p>Unzip the file</p><pre>chmod +x merge_cli<br>./merge_cli --folder path_to_folder</pre><p>No Python, no setup, no dependencies.</p><h3>Lessons Learned</h3><h4>1. PyInstaller is smooth on macOS runners</h4><p>Even heavy libraries like OpenCV worked fine.</p><h4>2. Never try to cross-compile macOS binaries on Linux</h4><p>It won’t work.<br> Use a real macOS environment — GitHub Actions is the easiest option.</p><h4>3. GitHub macOS runners are powerful</h4><p>They are perfect for:</p><ul><li>building macOS apps</li><li>packaging command line tools</li><li>testing macOS-specific libraries</li><li>CI/CD pipelines</li></ul><h4>4. Automate everything</h4><p>Now every push to master gives me new Linux, Windows, and macOS binaries.<br> This is the real power of CI.</p><blockquote><em>Code : </em><a href="https://github.com/sanatankafle12/merge_cli_tool">https://github.com/sanatankafle12/merge_cli_tool</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=404959830482" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Peripherals of an ML Engineer: What Goes Beyond Just Training the Model]]></title>
            <link>https://medium.com/@sakafle/the-peripherals-of-an-ml-engineer-what-goes-beyond-just-training-the-model-ed5aeafff3cf?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed5aeafff3cf</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 09:59:09 GMT</pubDate>
            <atom:updated>2025-10-30T07:19:17.997Z</atom:updated>
            <content:encoded><![CDATA[<p>Everyone talks about training models. But few talk about what happens <em>after</em>. Let’s explore the tools and systems that make machine learning actually work in the real world.</p><p>Once the model reaches a decent accuracy in a Jupyter notebook, the real journey begins , packaging it, versioning the data, managing experiments, setting up APIs, and deploying it so others can actually use it. This is where an ML engineer steps beyond theory and enters the world of engineering where reproducibility, scalability, and maintainability matter as much as accuracy.</p><p>In this article, we’ll look at the <strong>peripherals of a Machine Learning Engineer</strong>, the often overlooked but absolutely essential components that transform a model into a usable, production ready system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IwRgD_ZWNt90eSYKbQ03TQ.jpeg" /></figure><p>When we talk about the <em>peripherals</em> of ML engineering, we’re not just referring to the fancy tools that support model deployment. We’re talking about the <strong>thinking framework</strong>, the broader technical and logical skill set that keeps an ML engineer effective, even when there’s no model in sight.</p><p>Because here’s the reality:<br> In most ML jobs, 60–70% of your time isn’t spent training models. It’s spent on <strong>making the model useful</strong>, <strong>scalable</strong>, and <strong>understandable</strong>. Let’s explore what those peripherals look like.</p><h3><strong>📊 Data Management &amp; Preparation</strong></h3><ul><li><strong>Core Focus</strong>: Here, we build scalable pipelines for data ingestion, cleaning, transformation, and storage to prep high quality datasets for training, avoiding bottlenecks in ETL, imbalanced data handling, and feature engineering.</li><li><strong>Key Processes</strong>: ETL workflows, anomaly detection, normalization, and feature stores for reusable, versioned features.</li><li><strong>Why it Matters:</strong> Poor data management accounts for ~80% of machine learning (ML) project failures. Automation ensures reproducibility and efficiency.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><h4>🗂️ DVC (Data Version Control)</h4><p>DVC is a free open source tool that is used for data versioning, i.e a git for data. It tracks changes in the files which makes collaboration, sharing and reproducibility easier.</p><p>💡 <strong>Example:</strong><br> Imagine you’re working on a machine learning project to predict house prices. Your dataset (around <strong>1GB</strong>) contains property listings.<br> When there are new sales data, DVC automatically creates new version from which your teammates can pull only the updated dataset instead of re downloading the entire dataset.</p><h4>🌀 Apache Airflow</h4><p>Apache Airflow is used to define, schedule and monitor data pipelines. It helps automate complex tasks and provides a UI to track and manage workflows in real time.</p><p><strong>💡Example:</strong></p><p>Imagine you’re building a house price prediction ML model. Your workflow: pull daily property data from an API, clean it, train the model, and update a dashboard.</p><p>With Apache Airflow, define this as a DAG of tasks (e.g., fetch data → clean outliers → retrain model). Schedule it to run nightly at 2 AM for full automation. Its UI lets you monitor in real time if data fetch fails (say, API outage), it alerts you and retries, keeping your team with fresh predictions hassle free.</p><h4>⚡ Apache Kafka</h4><p>Apache Kafka is used to handle real time data flows across distributed environments.</p><p>💡 <strong>Example:</strong></p><p>Imagine you’re building a house price prediction ML model. New property listings stream in real time from multiple sources like APIs and user uploads.</p><p>With Apache Kafka, treat these as event streams published to topics (e.g., “raw_listings”). Consumers subscribe to process them instantly e.g., one cleans data for outliers, another feeds it to your model for live predictions. It scales seamlessly for high volume data without losing events, so your dashboard updates in seconds, not batches, keeping your team with real time insights even during traffic spikes.</p><h4>🧩 GraphQL</h4><p>GraphQL is a query language for APIs that allows clients to request exactly the data they need. Unlike traditional REST APIs, it prevents over fetching and under fetching by enabling single, precise queries defined by a clear schema</p><p>💡 <strong>Example:</strong></p><p>Imagine you’re building a house price prediction ML model. Your dashboard needs to fetch specific property details like prices, locations, and features without overloading the server.</p><p>With GraphQL, define a single endpoint where queries request exactly what you need (e.g., { properties(location: “NYC”) { price, beds, sqFt } }). Your frontend gets only relevant data in one round trip, reducing bandwidth and latency. If the model updates predictions, teammates query fresh results instantly via nested queries, keeping everyone synced without custom APIs per view.</p><h3><strong>🔢 Math Beyond ML</strong></h3><p>Core Focus:</p><p>Applying foundational and advanced mathematical concepts outside core ML algorithms (e.g., not just gradients in neural nets) to enhance model design, data processing, validation, and integration. Mathematics plays an important role in Analysis, Post Processing, 3D spaces etc.</p><p><strong>Key Applications &amp; How It’s Used</strong>:</p><ul><li><strong>📐 3D Measurement Mathematics:</strong> Imagine LiDAR scanning a house for your price model. Vector geometry and trig compute 3D volumes/distances via integrals, estimating livable space precisely.</li><li><strong>👁️ Post-Processing in Computer Vision:</strong> The output of from Computer Vision Model needs to be transformed, converted or projected to your own use case.</li><li><strong>📊 Analytic Math for Result Interpretation:</strong> Imagine explaining house price predictions. Partial derivatives show how small changes in inputs like interest rates affect outputs.</li><li><strong>📈 Statistical Inference &amp; Uncertainty:</strong> Imagine validating house price features in shaky markets. Bayesian methods give uncertainty intervals (e.g., on bedroom impact) for risky areas. T-tests A/B test features like sq ft vs. schools, prioritizing winners without overfitting.</li><li><strong>🔊 Signal Processing &amp; Time-Series:</strong> Imagine denoising sales data for your house model. Fourier transforms filter seasonal noise for trend extraction. Kalman filters fuse live feeds with history, estimating “true” prices in seconds for buyer alerts.</li><li><strong>🌐 Graph &amp; Network Analysis:</strong> Imagine graphing neighborhood price influences — nodes for homes, edges for proximity. Spectral theory clusters “hot/cooling” areas via eigenvalues. Matrix exponentials predict sale ripples in realtor networks, +20% recommendation accuracy.</li></ul><h3><strong>⚙️ Backend &amp; API Logic</strong></h3><ul><li><strong>Core Focus</strong>: As a Machine Learning Engineer, Backend and API logics are key essentials to develop foundational server-side architecture that integrates ML model into logic.</li><li><strong>Key Processes</strong>: Event Driven Architecture, Queuing, Request Handling, Caching etc</li><li><strong>Why It Matters</strong>: Backend logic holds ML in production to control latency, data inconsistency, scalability, inference time depending upon the need.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><p><strong>🔥 FastAPI/Backend Framework</strong> <strong>:</strong> FastAPI is used for APIs in Machine Learning mostly because they are lightweight, simpler to use and sufficient for most of the tasks. They are great for models deployment without any fuss.</p><p>💡<strong>Example:</strong>Imagine building a house price ML model. Users query the API for instant valuations by location/features. With FastAPI, create /predict?address=123 Main St endpoints that validate inputs (Pydantic schemas for coords), run the model async, and return JSON. Auto Swagger UI lets teams test live, slashing debug time and scaling to 1,000 reqs/sec cleanly.</p><p><strong>🐙 Celery</strong> <strong>:</strong> Celery queues background tasks which are useful when ML does heavy tasks without freezing the app.</p><p>💡<strong>Example: </strong>Imaging there are some predictions to be run on a model that takes a long time. The predictions happens in the background and you can freely roam in the app without any obstruction. After the prediction is completed, as per the requirement, the output is displayed.</p><p><strong>⚡ Redis</strong> <strong>:</strong> Redis is a super fast in memory store for caching, sessions, and queues. It is perfect for ML caching predictions or real-time data.</p><p>💡<strong>Example:</strong> Imagine users querying your house price API for similar neighborhoods often. Redis caches results (redis.set(‘nyc_prices’, json.dumps(predictions), ex=3600)) for 1 hour access at</p><h3><strong>🐳 Containerization &amp; Orchestration</strong></h3><ul><li><strong>Core Focus</strong>: Pack ML models, code, and pipelines into lightweight, portable containers , then manage their rollout, scaling, and ops across setups from local dev to cloud clusters for reliable, anywhere execution.</li><li><strong>Key Processes</strong>: Image building/tagging, multistage Dockerfiles for slim ML artifacts, service discovery, rolling updates/blue-green deploys, resource quotas for GPU/TPU allocation, health checks/liveness probes, secret management, and auto-scaling based on ML specific metrics like inference latency or batch size.</li><li><strong>Why It Matters</strong>: Containers eliminate “it works on my machine” issues, accelerating ML deployments by 5–10x.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><p>🐳 Docker</p><p>Simple Explanation: Docker is a platform that packages applications and their dependencies into lightweight, portable containers , think of it as shipping your code in self contained boxes that run consistently anywhere, from your laptop to the cloud, without “it works on my machine” drama.</p><p>💡Example: The API build on my system with specific library is build into an image which is deployed in a server which will then replicate all the libraries that are needed for it and run on any device.</p><pre>FROM python:3.9-slim<br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install -r requirements.txt<br>COPY . .<br>CMD [&quot;python&quot;, &quot;serve_model.py&quot;]<br></pre><h3><strong>☁️ Cloud &amp; Infrastructure Integration</strong></h3><ul><li><strong>Core Focus</strong>: Provision, configure, and manage cloud resources tailored for ML workloads, integrating storage, compute, networking, and monitoring to create hybrid/multicloud environments that support seamless data flows, training, and inference at scale.</li><li><strong>Key Processes</strong>: Infrastructure as Code (IaC) templating, resource provisioning (e.g., GPU clusters), networking/VPC setup for secure data transfer, cost optimization tagging, hybrid cloud federation, and integration with on prem systems for ML pipelines.</li><li><strong>Why It Matters</strong>: Cloud infra powers 90% of production ML in 2025. Poor integration leads to ballooning costs effective setups enable elastic scaling.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><p><strong>🔧 Terraform</strong> <strong>:</strong> Terraform is an IaC tool for coding cloud setups declaratively.</p><p>💡<strong>Example:</strong> Imagine ramping up your house price ML model during spring buying rushes. Write HCL code to auto launch AWS GPU servers (resource “aws_instance” { ami = “ml-gpu” }), run terraform apply to deploy, and destroy after.</p><p><strong>☁️ AWS (Focus: SageMaker for ML)</strong> <strong>:</strong> AWS is Amazon’s cloud giant for compute/storage/networks. SageMaker is its ML hub for end to end workflows.</p><h3><strong>⚙️ CI/CD &amp; Automation</strong></h3><ul><li><strong>Core Focus</strong>: Automate the ML lifecycle through continuous integration (testing code/data/models), continuous delivery (staging deploys), and continuous deployment (prod rollouts), incorporating MLOps practices for versioned pipelines and automated retraining triggers.</li><li><strong>Key Processes</strong>: Pipeline orchestration, automated testing (unit/integration for ML code), artifact promotion, rollback mechanisms, secret injection, and GitOps for declarative ML workflows with notifications on failures.</li><li><strong>Why It Matters</strong>: Manual processes slow ML iteration by weeks; CI/CD enables 20x faster releases, reduces errors by 70%, and supports agile teams in dynamic 2025 environments like rapid LLM fine tuning for customer support bots.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><p><strong>🚀 GitHub Actions</strong> <strong>:</strong> GitHub Actions is a built in CI/CD platform for automating workflows via YAML. They trigger on repo events, runs jobs on virtual runners, and integrates with tools like Docker/DVC for ML pipelines.</p><p>💡<strong>Example:</strong> Imagine automating your house price ML pipeline. This YAML workflow triggers on pushes.No manual runs keeps models fresh and deployable in minutes.</p><pre>name: ML Pipeline<br>on: [push]<br>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v2<br>      - name: Run DVC<br>        run: dvc repro<br>      - name: Test Model<br>        run: pytest tests/<br>  deploy:<br>    needs: test<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Build Docker<br>        run: docker build -t ml-app .<br>      - name: Push to Registry<br>        run: docker push myrepo/ml-app:latest</pre><h3><strong>🚀 Scalability &amp; Optimization</strong></h3><ul><li><strong>Core Focus</strong>: Enhance ML systems for handling growing loads through horizontal/vertical scaling, performance tuning, and resource efficiency, focusing on inference speed, cost reduction, and adaptive resource allocation in dynamic environments.</li><li><strong>Key Processes</strong>: Load balancing, model compression (pruning/quantization), caching layers, auto scaling policies based on metrics, profiling bottlenecks, and sustainability audits for green ML ops.</li><li><strong>Why It Matters</strong>: ML costs can explode 100x with scale. Optimization delivers 5–10x throughput gains and 50% cost cuts, vital for 2025’s edge AI boom in scenarios like video analytics or large scale simulations.</li></ul><p><strong>Essential Tools &amp; Main Usages</strong></p><p><strong>⚡ TensorRT</strong> <strong>:</strong> TensorRT optimizes deep learning inference on NVIDIA GPUs via layer fusion and quantization which boosts speed for production ML.</p><p>💡<strong>Example:</strong> Imagine optimizing your house price CNN for image based valuations (e.g., photo features). TensorRT converts the ONNX model (trtexec — onnx=model.onnx), quantizes to INT8 for 4x speedup, and runs on edge devices. Handles 1k queries/sec at &lt;50ms latency, cutting cloud bills 60% during peak listing seasons.</p><p><strong>🗜️ ONNX Runtime</strong> <strong>:</strong> ONNX Runtime runs optimized inference across hardware (CPU/GPU) that supports model export/import for portable, fast executions.</p><p><strong>Example:</strong> Imagine exporting your house price model to ONNX for multi platform deploys. Runtime loads it (ort_session = InferenceSession(‘model.onnx’)), enables graph optimizations for 3x faster runs, and caches embeddings for repeated location queries. Scales to mobile apps for on site agent estimates, reducing server load 40%.</p><h3>📝 TLDR</h3><p><strong>🚀 Reality Shift:</strong> 60–70% of ML time is engineering — not training; master peripherals for scalable, reproducible systems.</p><p><strong>📊 Data Prep:</strong> ETL pipelines with DVC (data Git), Airflow (DAG scheduler), Kafka (streams), GraphQL (smart queries) fix 80% failures via automation.</p><p><strong>📐 3D Math:</strong> Vector trig/integrals for LiDAR volumes, precise property features like livable space.</p><p><strong>👁️ CV Post-Processing:</strong> Projections/homographies + surface calcs transform model outputs for real metrics (e.g., roof areas).</p><p><strong>📊 Analytics Math:</strong> Derivatives/Taylor series explain sensitivities (rate impacts) and bound errors for trust.</p><p><strong>📈 Stats/Uncert:</strong> Bayesian intervals + t-tests for risk quant + feature validation, no overfitting.</p><p><strong>🔊 Signals/Time-Series:</strong> Fourier/Kalman denoise/fuse data for instant trend alerts.</p><p><strong>🌐 Graphs:</strong> Spectral clustering/exponentials model ripples, +20% rec accuracy.</p><p><strong>⚙️ Backend/API:</strong> FastAPI (async serves), Celery (queues), Redis (cache) tame latency/scalability.</p><p><strong>🐳☁️⚙️🚀 CI/CD/Scale:</strong> Docker/Terraform/SageMaker/Actions for deploys; TensorRT/ONNX for 5–10x speed/50% savings elastic, green ML wins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed5aeafff3cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom MMPose Model.]]></title>
            <link>https://medium.com/@sakafle/custom-mmpose-model-916152ebc9c0?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/916152ebc9c0</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 07:35:33 GMT</pubDate>
            <atom:updated>2025-08-05T13:41:16.009Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://mmpose.readthedocs.io/en/latest/"><strong>MMPose</strong></a> is an open-source toolbox developed by <strong>OpenMMLab</strong> for <strong>human pose estimation</strong>, <strong>animal pose estimation</strong>, and <strong>whole-body pose estimation</strong>. Built on top of the <strong>MMCV</strong> and <strong>MMEngine</strong> frameworks, MMPose supports a wide range of powerful and modern models, such as:</p><ul><li><strong>ViT-based models</strong> (e.g., MSPN with Vision Transformers)</li><li><strong>HRNet</strong></li><li><strong>RTMPose</strong> (real-time performance)</li><li><strong>SimpleBaseline</strong>, <strong>DEKR</strong>, <strong>Hourglass</strong>, and more.</li></ul><p>MMPose supports both <strong>top-down</strong> and <strong>bottom-up</strong> pipelines and includes tools for:</p><ul><li>Training and evaluating pose estimation models</li><li>Visualizing keypoints and predictions</li><li>Dataset conversion and preprocessing</li><li>Model deployment and ONNX export</li></ul><h3>Top-Down Approach</h3><p>🧍 Detect humans <strong>first</strong>, then estimate <strong>keypoints for each detected person individually</strong>.</p><h3>Bottom-Up Approach</h3><p>🔘 Detect <strong>all keypoints in the image first</strong>, then <strong>group them</strong> into individuals.</p><p><strong>PREREQUISITES</strong>:</p><ul><li>Python 3.7 or later (recommended: 3.7 to 3.10)</li><li>PyTorch (compatible with your CUDA version)</li><li>Git</li></ul><h3><strong>🚀 Installation Steps</strong></h3><h4>🔧 Step 1: Create Conda Environment</h4><pre>conda create - name openmmlab python=3.8 -y<br>conda activate openmmlab</pre><h4>🔧 Step 2: Install Dependencies</h4><p><strong>Install mim, mmengine, and compatible mmcv:</strong></p><pre>pip install -U openmim<br>mim install mmengine<br>mim install &quot;mmcv&gt;=2.0.1&quot;</pre><p><strong>Install compatible PyTorch:</strong></p><p>Use the<a href="https://pytorch.org/get-started/locally/"> PyTorch Installation Guide</a> to install the appropriate version based on your CUDA version.</p><p><strong>Example for CUDA 11.7:</strong></p><pre>pip install torch torchvision torchaudio - index-url https://download.pytorch.org/whl/cu117</pre><p><strong>Install MMDetection (required for some detectors):</strong></p><pre>mim install &quot;mmdet&gt;=3.1.0&quot;</pre><p>⚠️ Make sure the versions of mmcv, mmdet, and pytorch are compatible with each other.</p><h4>🔧 Step 3: Install MMPose</h4><pre>git clone https://github.com/open-mmlab/mmpose.git<br>cd mmpose<br>pip install -r requirements.txt<br>pip install -v -e .</pre><h3><strong>To Verify the installation:</strong></h3><p>Step 1: Download Pretrained Model</p><pre>mim download mmpose - config td-hm_hrnet-w48_8xb32–210e_coco-256x192 - dest .</pre><p>Step 2: Run Inference on Image</p><pre>python demo/image_demo.py \<br>tests/data/coco/000000000785.jpg \<br>td-hm_hrnet-w48_8xb32–210e_coco-256x192.py \<br>td-hm_hrnet-w48_8xb32–210e_coco-256x192–0e67c616_20220913.pth \<br> - out-file vis_results.jpg \<br> - draw-heatmap</pre><p>You should see a new file vis_results.jpg with keypoints drawn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*XkJMDT1ScETffgnH" /><figcaption>Example Output Image</figcaption></figure><h3>To Train Model on Custom Dataset</h3><p>When working with <strong>custom pose estimation tasks</strong>, the number of keypoints may vary. In my case, the number of keypoints were 14(instead of the standard 17 COCO keypoints), you need to <strong>customize the dataset configuration</strong> accordingly. This ensures MMPose knows how to interpret the keypoints, visualize them, and properly train your model.</p><h4><strong>1. Understand the Default Setup</strong></h4><p>MMPose provides dataset configs under:</p><blockquote>configs/_base_/datasets/</blockquote><h4><strong>2. Customize Dataset Config for Your Keypoints</strong></h4><p>Open the file:</p><blockquote>configs/_base_/datasets/<a href="http://coco.py/">coco.py</a></blockquote><p>Here, we are making changes to the COCO dataset which is why the basic config of coco.py is being changed.</p><pre>dataset_info = dict(<br>   dataset_name=&#39;coco_14kp&#39;,<br>   paper_info=dict(<br>       author=&#39;Lin, Tsung-Yi and Maire, Michael and &#39;<br>              &#39;Belongie, Serge and Hays, James and &#39;<br>              &#39;Perona, Pietro and Ramanan, Deva and &#39;<br>              r&#39;Doll{\&#39;a}r, Piotr and Zitnick, C Lawrence&#39;,<br>       title=&#39;Microsoft COCO: Common Objects in Context&#39;,<br>       container=&#39;European Conference on Computer Vision&#39;,<br>       year=&#39;2014&#39;,<br>       homepage=&#39;http://cocodataset.org/&#39;,<br>   ),<br>   keypoint_info={<br>       0: dict(name=&#39;mouthLip0&#39;, id=0, color=[255, 0, 0], type=&#39;mouth&#39;, swap=&#39;&#39;),<br>       1: dict(name=&#39;mouthLip1&#39;, id=1, color=[255, 0, 0], type=&#39;mouth&#39;, swap=&#39;&#39;),<br>        ..<br>        ..<br>        ..<br>   },<br>   skeleton_info={<br>       0: dict(link=(&#39;mouthLip0&#39;, &#39;mouthLip1&#39;), id=0, color=[255, 0, 0]),<br>       1: dict(link=(&#39;mouthLip1&#39;, &#39;gills&#39;), id=1, color=[255, 128, 0]),<br>        ..<br>        ..<br>        ..<br>   },<br>   joint_weights=[<br>       2.0, 2.0,  <br>        .. .. .. .. <br>   ],<br>   sigmas=[<br>       0.02, 0.02,<br>        .. .. .. ..<br>   ]<br>)</pre><ul><li><strong>keypoint_info</strong>: Defines each keypoint’s name, color for visualization, and if it has a left-right swap partner (if applicable).</li><li><strong>skeleton_info</strong>: Defines connections between keypoints to draw skeleton lines.</li><li><strong>joint_weights</strong>: The loss weighting for each keypoint during training.</li><li><strong>sigmas</strong>: Standard deviations used when computing Object Keypoint Similarity (OKS) for evaluation.</li></ul><p>Add more keypoints depending upon the need</p><h4><strong>3. Updated Custom MMPose Config File for Fish Pose Estimation ( Example: td-hm_hrnet-w48_8xb32–210e_fish-256x192.py)</strong></h4><pre>base_ = [&#39;../../../_base_/default_runtime.py&#39;]<br><br><br># 1. Runtime Configuration<br>train_cfg = dict(max_epochs=210, val_interval=10)<br><br><br># 2. Optimizer<br>optim_wrapper = dict(<br>   optimizer=dict(type=&#39;Adam&#39;, lr=5e-4)<br>)<br><br><br># 3. Learning Rate Schedule<br>param_scheduler = [<br>   dict(type=&#39;LinearLR&#39;, begin=0, end=500, start_factor=0.001, by_epoch=False),  # warm-up<br>   dict(type=&#39;MultiStepLR&#39;, begin=0, end=210, milestones=[170, 200], gamma=0.1, by_epoch=True),<br>]<br><br><br># 4. Auto scale LR<br>auto_scale_lr = dict(base_batch_size=512)<br><br><br># 5. Hooks<br>default_hooks = dict(<br>   checkpoint=dict(save_best=&#39;coco/AP&#39;, rule=&#39;greater&#39;)<br>)<br># 6. Codec (Heatmap Generator Settings)<br>codec = dict(<br>   type=&#39;MSRAHeatmap&#39;,<br>   input_size=(192, 256),<br>   heatmap_size=(48, 64),<br>   sigma=2<br>)<br><br><br># 7. Model Configuration<br>model = dict(<br>   type=&#39;TopdownPoseEstimator&#39;,<br>   data_preprocessor=dict(<br>       type=&#39;PoseDataPreprocessor&#39;,<br>       mean=[123.675, 116.28, 103.53],<br>       std=[58.395, 57.12, 57.375],<br>       bgr_to_rgb=True<br>   ),<br>   backbone=dict(<br>       type=&#39;HRNet&#39;,<br>       in_channels=3,<br>       extra=dict(<br>           stage1=dict(num_modules=1, num_branches=1, block=&#39;BOTTLENECK&#39;, num_blocks=(4,), num_channels=(64,)),<br>           stage2=dict(num_modules=1, num_branches=2, block=&#39;BASIC&#39;, num_blocks=(4, 4), num_channels=(48, 96)),<br>           stage3=dict(num_modules=4, num_branches=3, block=&#39;BASIC&#39;, num_blocks=(4, 4, 4), num_channels=(48, 96, 192)),<br>           stage4=dict(num_modules=3, num_branches=4, block=&#39;BASIC&#39;, num_blocks=(4, 4, 4, 4), num_channels=(48, 96, 192, 384)),<br>       ),<br>       init_cfg=dict(<br>           type=&#39;Pretrained&#39;,<br>           checkpoint=&#39;https://download.openmmlab.com/mmpose/pretrain_models/hrnet_w48-8ef0771d.pth&#39;<br>       )<br>   ),<br>   head=dict(<br>       type=&#39;HeatmapHead&#39;,<br>       in_channels=48,<br>       out_channels=14,  # 🔧 Set to your number of keypoints<br>       deconv_out_channels=None,<br>       loss=dict(type=&#39;KeypointMSELoss&#39;, use_target_weight=True),<br>       decoder=codec<br>   ),<br>   test_cfg=dict(flip_test=True, flip_mode=&#39;heatmap&#39;, shift_heatmap=True)<br>)<br><br><br># 8. Dataset Type and Mode<br>dataset_type = &#39;CocoDataset&#39;  # Use your custom dataset following COCO format<br>data_mode = &#39;topdown&#39;<br><br><br># 9. Pipelines<br>train_pipeline = [<br>   dict(type=&#39;LoadImage&#39;),<br>   dict(type=&#39;GetBBoxCenterScale&#39;),<br>   dict(type=&#39;RandomFlip&#39;, direction=&#39;horizontal&#39;),<br>   dict(type=&#39;RandomHalfBody&#39;),<br>   dict(type=&#39;RandomBBoxTransform&#39;),<br>   dict(type=&#39;TopdownAffine&#39;, input_size=codec[&#39;input_size&#39;]),<br>   dict(type=&#39;GenerateTarget&#39;, encoder=codec),<br>   dict(type=&#39;PackPoseInputs&#39;)<br>]<br><br><br>val_pipeline = [<br>   dict(type=&#39;LoadImage&#39;),<br>   dict(type=&#39;GetBBoxCenterScale&#39;),<br>   dict(type=&#39;TopdownAffine&#39;, input_size=codec[&#39;input_size&#39;]),<br>   dict(type=&#39;PackPoseInputs&#39;)<br>]<br><br><br># 10. DataLoader Configuration<br>train_dataloader = dict(<br>   batch_size=32,<br>   num_workers=4,<br>   persistent_workers=True,<br>   sampler=dict(type=&#39;DefaultSampler&#39;, shuffle=True),<br>   dataset=dict(<br>       type=dataset_type,<br>       data_root=&#39;data/&#39;,  # 🔧 Modify this to your dataset root path<br>       data_mode=data_mode,<br>       ann_file=&#39;annotations_1/annotations_train.json&#39;,  # 🔧 Update as needed<br>       data_prefix=dict(img=&#39;unzipped_chunks/&#39;),  # 🔧 Update as needed<br>       pipeline=train_pipeline,<br>   )<br>)<br><br><br>val_dataloader = dict(<br>   batch_size=32,<br>   num_workers=2,<br>   persistent_workers=True,<br>   drop_last=False,<br>   sampler=dict(type=&#39;DefaultSampler&#39;, shuffle=False, round_up=False),<br>   dataset=dict(<br>       type=dataset_type,<br>       data_root=&#39;data/&#39;,  # 🔧 Modify this to your dataset root path<br>       data_mode=data_mode,<br>       ann_file=&#39;annotations_1/annotations_val.json&#39;,  # 🔧 Update as needed<br>       data_prefix=dict(img=&#39;unzipped_chunks/&#39;),  # 🔧 Update as needed<br>       test_mode=True,<br>       pipeline=val_pipeline,<br>   )<br>)<br><br><br>test_dataloader = val_dataloader<br><br><br># 11. Evaluators<br>val_evaluator = dict(<br>   type=&#39;CocoMetric&#39;,<br>   ann_file=&#39;data/annotations_1/annotations_val.json&#39;,  # 🔧 Update as needed<br>)<br><br><br>test_evaluator = val_evaluator</pre><p>data_prefix = dict(img=&lt;update your image path&gt;)</p><p>For annotations, make changes to ann_file</p><p>The thing to make sure is that you do this making sure that all your images and annotations are inside data/ folder. If it is in different folder, make changes to the data_root</p><h4><strong>4. Annotation and splitting correctly:</strong></h4><p>We used CVAT for annotating the file. You can use any tool you want. Make sure the annotation is in COCO format. Split the annotation to val and train. You can also using test as well if required.</p><h4><strong>5. Training the model:</strong></h4><pre>python tools/train.py \<br>configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w48_8xb32–210e_coco-256x192.py \<br> - work-dir ./work_dirs/mmpose_runs</pre><ul><li><strong>tools/train.py: Script used to start training.</strong></li><li><strong>configs/…/td-hm_hrnet-w48…py: The configuration file, which specifies the model, dataset, and training settings.</strong></li><li><strong>work-dir: The folder where logs, checkpoints, and results will be saved.</strong></li></ul><h4>6. To make the Predictions</h4><pre>python demo/image_demo.py \<br>  &lt;image_path&gt; \<br>  &lt;config_path&gt; \<br>  &lt;checkpoint_path&gt; \<br>  --out-file &lt;output_path&gt;</pre><h3>TLDR:</h3><ul><li><strong>Custom Pose Estimation:</strong> Learn to train specialized pose estimation models using OpenMMLab’s MMPose.</li><li><strong>Step-by-Step Setup:</strong> Covers environment installation for MMPose, PyTorch, and MMDetection.</li><li><strong>Dataset Customization:</strong> Guides you on defining unique keypoints and skeletons for your own datasets (e.g., 14 keypoints for fish).</li><li><strong>Model Configuration:</strong> Shows how to adapt MMPose’s config files to integrate your custom dataset and keypoint definitions.</li><li><strong>Training &amp; Prediction:</strong> Provides commands for training your custom model and making predictions on new images.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=916152ebc9c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Pose Estimation Annotation in CVAT with Serverless Deployment]]></title>
            <link>https://medium.com/@sakafle/automating-pose-estimation-annotation-in-cvat-with-serverless-deployment-f8a6167161a7?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8a6167161a7</guid>
            <category><![CDATA[annotations]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[annotation-tools]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 04:00:28 GMT</pubDate>
            <atom:updated>2025-03-19T04:00:28.064Z</atom:updated>
            <content:encoded><![CDATA[<p>The Computer Vision Annotation Tool (CVAT) has been instrumental in aiding annotators to label data efficiently. Building upon this foundation, the GitHub repository <a href="https://github.com/sanatankafle12/cvat-pose-estimation-automation">cvat-pose-estimation-automation</a> introduces enhancements to streamline pose estimation annotation processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*0NzdtD4ACEtXXFFP4AFZqg.png" /><figcaption>Pose Estimation</figcaption></figure><h3>YOLOv8 Pose Estimation Function Breakdown</h3><p>This function is designed to perform pose estimation using the YOLOv8 model, extracting keypoints and generating a structured output for further processing. Below is a breakdown of its components.</p><h4>1. Model Initialization</h4><p>The init_context function initializes the YOLOv8 pose estimation model and stores it for use in inference requests.</p><pre># Initialize your model<br>def init_context(context):<br>    context.logger.info(&#39;Initializing YOLOv8 pose estimation model...  0%&#39;)<br>    model = YOLO(&#39;YOUR-MODEL-NAME&#39;)  # Load the YOLOv8 pose estimation model<br>    context.user_data.model_handler = model<br>    context.logger.info(&#39;YOLOv8 pose estimation model initialized...100%&#39;)</pre><ul><li>The model is loaded using the YOLO class.</li><li>It is stored in context.user_data to be accessed later during inference.</li></ul><h4>2. Inference Handling</h4><p>The handler function processes incoming images, runs pose estimation, and returns detected keypoints and skeletons.</p><pre># Inference endpoint<br>def handler(context, event):<br>    context.logger.info(&#39;Running pose estimation on input image using YOLOv8 model&#39;)</pre><pre>    # Decode the input image from base64<br>    data = event.body<br>    image_buffer = io.BytesIO(base64.b64decode(data[&#39;image&#39;]))<br>    image = cv2.imdecode(np.frombuffer(image_buffer.getvalue(), np.uint8), cv2.IMREAD_COLOR)</pre><ul><li>The image is received in base64 format and decoded for processing.</li><li>OpenCV (cv2) is used to read the image into a numpy array.</li></ul><h4>3. Model Inference</h4><pre># Perform inference using the YOLOv8 model<br>    results = context.user_data.model_handler(image)<br>    result = results[0]</pre><ul><li>The stored model is used to run inference on the input image.</li><li>The results contain detected objects, keypoints, and confidence scores.</li></ul><h4>4. Extracting Keypoints and Confidence Scores</h4><pre># Extract bounding boxes, keypoints, confidences, and class labels<br>    boxes = result.boxes.data[:, :4]  # Extract bounding boxes<br>    keypoints = result.keypoints.data[:, :, :2]  # Extract keypoints (x, y coordinates)<br>    confs = result.boxes.conf  # Confidence scores for each detection<br>    clss = result.boxes.cls  # Class labels<br>    class_names = result.names  # Class names dictionary</pre><ul><li>Bounding boxes define object locations.</li><li>Keypoints contain the (x, y) coordinates of detected points.</li><li>Confidence scores and class labels are extracted for filtering and identification.</li></ul><h4>5. Formatting the Output</h4><pre>detections = []<br>    threshold = 0.1  # Confidence threshold for filtering detections</pre><pre>    for box, keypoint_set, conf, cls in zip(boxes, keypoints, confs, clss):<br>        label = class_names[int(cls)]<br>        keypoints_list = keypoint_set.tolist()  # Convert keypoints to list format<br>        elements = []<br>        for index, key_points in enumerate(keypoints_list, start=1):<br>            elements.append({<br>                &#39;confidence&#39;: &#39;0.9&#39;,<br>                &#39;label&#39;: str(index),<br>                &#39;points&#39;: [float(key_points[0]), float(key_points[1])],<br>                &#39;type&#39;: &#39;points&#39;,  # Indicate that this is a pose estimation<br>            })<br>        skeleton = [{<br>            &#39;confidence&#39;: &#39;0.9&#39;,<br>            &#39;label&#39;: class_names[int(cls)],<br>            &#39;type&#39;: &#39;skeleton&#39;,<br>            &#39;elements&#39;: elements,<br>        }]<br>        context.logger.info(f&quot;skeleton:{skeleton}&quot;)</pre><ul><li>Each detection is structured into elements, where each keypoint is stored as a dictionary.</li><li>The entire skeleton is then assembled, including confidence scores.</li></ul><h4>6. Returning the Response</h4><pre>return context.Response(body=json.dumps(skeleton), headers={}, content_type=&#39;application/json&#39;, status_code=200)</pre><ul><li>The output is formatted as JSON and returned via an HTTP response.</li></ul><h3>TLDR:</h3><p>This function <strong>automates pose estimation annotation</strong> in <strong>CVAT</strong> using <strong>YOLOv8</strong>.</p><ul><li>YOLOv8 model is loaded and stored for inference.</li><li>Image received in base64 format, decoded using OpenCV.</li><li>YOLOv8 performs pose estimation.</li><li>Bounding boxes, keypoints, confidence scores, and class labels are extracted.</li><li>Keypoints are structured as <strong>skeletons</strong> for pose estimation.</li><li>JSON output is returned with detected keypoints.</li><li>The process of running CVAT serverless is described in the GitHub repo mentioned above.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8a6167161a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Year for Bollywood Movies : 2007]]></title>
            <link>https://medium.com/@sakafle/best-year-for-bollywood-movies-2007-a9eb9ae4552b?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9eb9ae4552b</guid>
            <category><![CDATA[bollywood]]></category>
            <category><![CDATA[movies]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 17:46:13 GMT</pubDate>
            <atom:updated>2024-08-16T17:46:13.137Z</atom:updated>
            <content:encoded><![CDATA[<h3>Best Year for Bollywood Movies : 2007</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjZxCs8AvNloF4bERWQZ_Q.png" /><figcaption>Top Movies from 2007</figcaption></figure><p>In 2007, Bollywood had a great year with a wide range of films that really engaged audiences. The year featured dramas, comedies, and action movies, showing a trend towards deeper storytelling and creative filmmaking. With a combination of well-known actors and new faces, 2007 proved Bollywood’s talent for both entertaining and making people think, making it a standout year in Indian cinema.</p><h3><strong>Notable Films</strong></h3><p><strong>Om Shanti Om</strong></p><ul><li><strong>Genre:</strong> Reincarnation Drama, Romance</li><li><strong>Plot:</strong> A junior artist from the 1970s is murdered and reincarnates to seek revenge in the present day.</li><li><strong>Main Actors:</strong> Shah Rukh Khan (Om), Deepika Padukone (Shanti), Arjun Rampal.</li></ul><p><strong>Taare Zameen Par</strong></p><ul><li><strong>Genre:</strong> Drama, Family</li><li><strong>Plot:</strong> A dyslexic child struggles in school until a new art teacher helps him discover his talent.</li><li><strong>Main Actors:</strong> Aamir Khan (Ram Shankar Nikumbh), Darsheel Safary (Ishaan Awasthi), Tisca Chopra.</li></ul><p><strong>Jab We Met</strong></p><ul><li><strong>Genre:</strong> Romantic Comedy</li><li><strong>Plot:</strong> A chance encounter on a train leads to a transformative journey for a heartbroken businessman and a lively young woman.</li><li><strong>Main Actors:</strong> Shahid Kapoor (Aditya), Kareena Kapoor (Geet), Dara Singh.</li></ul><p><strong>Guru</strong></p><ul><li><strong>Genre:</strong> Drama, Biographical</li><li><strong>Plot:</strong> The rise of a man from a small village to a successful industrialist, navigating challenges and controversies.</li><li><strong>Main Actors:</strong> Abhishek Bachchan (Guru), Aishwarya Rai Bachchan, Mithun Chakraborty.</li></ul><p><strong>Welcome</strong></p><ul><li><strong>Genre:</strong> Comedy</li><li><strong>Plot:</strong> A comedy about a gangster who tries to marry off his sister to a respectable family, only to find out the groom’s family has its own secrets.</li><li><strong>Main Actors:</strong> Akshay Kumar (Majnu Bhai), Katrina Kaif, Anil Kapoor, Nana Patekar.</li></ul><p><strong>Bheja Fry</strong></p><ul><li><strong>Genre:</strong> Comedy</li><li><strong>Plot:</strong> A wealthy man invites a simpleton for dinner, leading to a series of hilarious misunderstandings.</li><li><strong>Main Actors:</strong> Vinay Pathak (Friedman), Rajat Kapoor (Ranjeet Thadani), Sarika.</li></ul><p><strong>Bhool Bhulaiyaa</strong></p><ul><li><strong>Genre:</strong> Psychological Thriller, Comedy</li><li><strong>Plot:</strong> A couple returns to their ancestral home, encountering supernatural occurrences and unraveling a dark secret.</li><li><strong>Main Actors:</strong> Akshay Kumar (Dr. Aditya Shrivastav), Vidya Balan, Shiney Ahuja.</li></ul><p><strong>Heyy Baby</strong></p><ul><li><strong>Genre:</strong> Comedy, Drama</li><li><strong>Plot:</strong> Three bachelors’ lives change when they find a baby at their doorstep, leading them to become accidental parents.</li><li><strong>Main Actors:</strong> Akshay Kumar (Apoorva), Vidya Balan, Fardeen Khan.</li></ul><p><strong>Dhamaal</strong></p><ul><li><strong>Genre:</strong> Comedy</li><li><strong>Plot:</strong> Four friends discover a hidden treasure and go on a madcap adventure to find it, encountering numerous challenges.</li><li><strong>Main Actors:</strong> Sanjay Dutt, Arshad Warsi, Javed Jaffrey, Riteish Deshmukh.</li></ul><p><strong>“Dhol”</strong></p><ul><li><strong>Genre:</strong> Comedy</li><li><strong>Plot:</strong> Four friends get entangled in a series of misunderstandings while trying to become rich by marrying a wealthy girl.</li><li><strong>Main Actors:</strong> Kunal Khemu, Sharman Joshi, Rajpal Yadav, Tusshar Kapoor.</li></ul><p><strong>Namastey London</strong></p><ul><li><strong>Genre:</strong> Romantic Comedy, Drama</li><li><strong>Plot:</strong> A romantic drama about a man who falls in love with a British woman, only to face cultural differences and family challenges.</li><li><strong>Main Actors:</strong> Akshay Kumar (Arjun), Katrina Kaif (Jazz), Rishi Kapoor.</li></ul><p><strong>Black Friday</strong></p><ul><li><strong>Genre:</strong> Crime, Drama</li><li><strong>Plot:</strong> A crime drama based on the 1993 Bombay bombings, depicting the events leading up to and following the attacks.</li><li><strong>Main Actors:</strong> Kay Kay Menon (Rakesh Maria), Anurag Kashyap, Ayesha Takia.</li></ul><p><strong>No Smoking</strong></p><ul><li><strong>Genre:</strong> Psychological Thriller, Drama</li><li><strong>Plot:</strong> A psychological drama about a man obsessed with quitting smoking and facing bizarre consequences.</li><li><strong>Main Actors:</strong> John Abraham (K), Ayesha Takia, Paresh Rawal.</li></ul><p><strong>Johnny Gaddaar</strong></p><ul><li><strong>Genre:</strong> Crime Thriller</li><li><strong>Plot:</strong> A thriller about a group of criminals who plan a heist but face betrayal and deception within their ranks.</li><li><strong>Main Actors:</strong> Neil Nitin Mukesh (Johnny), Dharmendra, Vinay Pathak.</li></ul><p><strong>Life in a… Metro</strong></p><ul><li><strong>Genre:</strong> Drama, Ensemble Film</li><li><strong>Plot:</strong> An ensemble drama exploring the interconnected lives of several people living in Mumbai, dealing with love, relationships, and aspirations.</li><li><strong>Main Actors:</strong> Dharmendra, Shilpa Shetty, Konkona Sen Sharma, Kay Kay Menon.</li></ul><p><strong>Dhan Dhana Dhan Goal</strong></p><ul><li><strong>Genre:</strong> Sports Drama</li><li><strong>Plot:</strong> A sports drama about a struggling football team trying to rise to the top of the football league amidst various challenges.</li><li><strong>Main Actors:</strong> Abhishek Bachchan, Bipasha Basu, John Abraham.</li></ul><p><strong>Shootout at Lokhandwala</strong></p><ul><li><strong>Genre:</strong> Crime, Action</li><li><strong>Plot:</strong> A crime film based on a real-life shootout between police and gangsters in Mumbai, showcasing the events from both perspectives.</li><li><strong>Main Actors:</strong> Vivek Oberoi, Abhishek Bachchan, Sanjay Dutt.</li></ul><h3><strong>Mix Of Genres</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*-jm2BjqPwm9zKJRU1Y0MKA.jpeg" /></figure><p><strong>Dramas:</strong> Taare Zameen Par, Guru, Life in a… Metro, Black Friday, Eklavya: The Royal Guard, Halla Bol, Chakde! India</p><p><strong>Comedies:</strong> Welcome, Bheja Fry, Heyy Baby, Dhamaal, Dhol, Partner, Fool N Final, Cash</p><p><strong>Romantic Comedies:</strong> Jab We Met, Namastey London</p><p><strong>Thrillers:</strong> Bhool Bhulaiyaa, Johnny Gaddaar, No Smoking</p><p><strong>Sports Drama:</strong> Dhan Dhana Dhan Goal</p><p><strong>Crime and Action:</strong> Shootout at Lokhandwala, Cash</p><h3><strong>Legacy</strong></h3><p>2007 had a huge impact in Bollywood both commercially and as a cinematic experience. When talking about Legacy, I mean to focus more on how it introduced new people like Ranbir Kapoor in Sawariya, Deepika Padukone in Om Shanti OM, Neil Nitin Mukesh in Johnny Gadar and more.</p><p>Though Ranbir Kapoor’s Sawariya was a flop, we were introduced to one of the finest actors bollywood has seen following movies like Rocket Singh, Wake up Sid, Yeh Jawaani Yeh Deewani, Ajab Prem Ki Gajab Kahani, Brahmastra, Barfi, Rockstar and my personal favourite Tamasha.</p><p>Also, the year introduced us to Deepika Padukone, who ate and left no crumbs in her debut movie “Om Shanti Om” and there has been no stopping her ever since. Piku, Yeh Jawaani Yeh Deewani, Karthik Calling Karthik, Padmavaat, Kalki, the list keeps on going. Ah, can’t forget Tamasha.</p><p>Similarly, Movies like Om Shanti Om, Taare Zameen Par, No Smoking, Guru, Jab We Met have had there own legacy in the world of Bollywood.</p><p>Next — The best bollywood album of all time. Stay Tuned</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9eb9ae4552b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MLops and Tools : Getting started with automating the ML workflow]]></title>
            <link>https://medium.com/@sakafle/mlops-and-tools-getting-started-with-automating-the-ml-workflow-6cb59c63da81?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cb59c63da81</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Mon, 05 Aug 2024 05:21:54 GMT</pubDate>
            <atom:updated>2024-08-05T05:21:54.507Z</atom:updated>
            <content:encoded><![CDATA[<h3>MLops and Tools : Getting started with automating the ML workflow</h3><p>What were the parameters you set during that experiment last month? What was the accuracy you achieved? And what changes did you make to improve the model’s performance?</p><p>If you’re anything like me, you probably don’t have a clear recollection of the specifics of your previous machine learning experiments. It’s all too easy for the details to get lost in the shuffle, especially as the number and complexity of your projects grow.</p><h3><strong>What actually is MLops and Why do we need it?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*rF4IU1bctbH_EIN8p9CPTg.jpeg" /><figcaption>MLops</figcaption></figure><p>MLops = Machine Learning + Data engineering + DevOps</p><p>MLops, short for machine learning operations, is a concept that aims to address challenges faced in the development, deployment, and maintenance of machine learning systems. It deals with all the processes from data acquisition to model deployment and re-evaluation. With the world moving towards automation and cost-effectiveness, MLops is a vital skill to learn.</p><h3>Workflow of MLops</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lse1JGjCnuelQeUwkkKNKw.jpeg" /><figcaption>Basic Overflow</figcaption></figure><ol><li><strong>Data Acquisition</strong>:</li></ol><ul><li>Gather and ingest data from various sources, ensuring data quality and integrity.</li><li>Continuously monitor and update the data pipeline to adapt to changing requirements.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>Apache Kafka, Apache Spark, AWS Kinesis, Google Cloud Dataflow</li><li>Knowledge Required: Data engineering principles, data streaming and batch processing, data quality and preprocessing.</li></ul><p><strong>2. Data Analysis and Preprocessing</strong>:</p><ul><li>Explore and analyze the acquired data to understand its characteristics and identify relevant features.</li><li>Clean, transform, and prepare the data for model training, ensuring it meets the requirements of the ML algorithms.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>Pandas, Matplotlib, Scikit-learn, Apache Spark, Jupyter Notebook</li><li>Knowledge Required: Data analysis techniques, feature engineering, data visualization, data preprocessing.</li></ul><p><strong>3. Model Development and Experimentation</strong>:</p><ul><li>Design and implement various ML models, experimenting with different algorithms, hyperparameters, and architectures.</li><li>Monitor the performance of the models during the experimentation phase and select the best-performing model.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>TensorFlow, PyTorch, Scikit-learn, MLflow, DVC, Weights &amp; Biases</li><li>Knowledge Required: Machine learning algorithms, model optimization, hyperparameter tuning, model evaluation metrics.</li></ul><p><strong>4. Model Versioning and Tracking</strong></p><ul><li>Store and version-control the trained models, model artifacts, and associated metadata.</li><li>Maintain a central repository for easy access and traceability of the model lifecycle.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>Git, GitHub, MLflow, DVC, Comet AI, Neptune ai, Clear ML</li><li>Knowledge Required: Version control systems, model management, metadata tracking.</li></ul><p><strong>5. Continuous Integration and Continuous Deployment (CI/CD)</strong>:</p><ul><li>Automate the ML pipelines and models&#39; build, test, and deployment processes.</li><li>Ensure the reliability and consistency of the deployments across different environments.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>Jenkins, CircleCI, GitHub Actions, Docker, Kubernetes, Terraform</li><li>Knowledge Required: CI/CD principles, containerization, infrastructure as code, DevOps practices.</li></ul><p><strong>6. Model Serving and Inference</strong></p><ul><li>Deploy the trained models into production, making them available for real-time predictions or batch inference.</li><li>Implement a scalable and efficient model that serves the infrastructure to handle the expected workload.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>TensorFlow Serving, PyTorch Serve, KFServing, AWS SageMaker, Google Cloud AI Platform</li><li>Knowledge Required: Model deployment architectures, container orchestration, load balancing, scalability.</li></ul><p><strong>7. Monitoring and Observability</strong>:</p><ul><li>Monitor the performance, health, and accuracy of the deployed models in production.</li><li>Collect and analyze relevant metrics and logs to identify issues, measure SLIs/SLOs, and trigger necessary actions.</li></ul><p><em>Tools and Frameworks:</em></p><ul><li>Prometheus, Grafana, Elastic Stack, AWS CloudWatch, Google Cloud Monitoring</li><li>Knowledge Required: Monitoring and observability principles, metric collection and analysis, anomaly detection, and alerting.</li></ul><h3>TLDR</h3><ol><li>MLops is a process of integrating Machine Learning practices in Software Development</li><li>MLops is important as it addresses the challenges in developing, deploying, and maintaining ML systems, ensuring reliability, scalability, and continuous improvement.</li><li>The MLops workflow covers key steps like data acquisition, preprocessing, model development, versioning, CI/CD, serving, and monitoring.</li><li>MLops differs from the traditional approach by automating the entire ML pipeline, from data to deployment, ensuring consistency and reproducibility.</li><li>As it ML and resource optimization is rapidly growing, MLops will play a vital role in any organization.</li></ol><p>Note:<br>More about MLops Tools in Future Article, Stay tuned. :) :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cb59c63da81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Conundrum of Choosing a Field in Tech as a beginner]]></title>
            <link>https://medium.com/@sakafle/the-conundrum-of-choosing-a-field-in-tech-as-a-beginner-ee170cce7298?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee170cce7298</guid>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[future]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 06:53:06 GMT</pubDate>
            <atom:updated>2024-08-12T11:22:25.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9airmYgDV5dGcSt7geCJw.jpeg" /><figcaption>Stacks in tech</figcaption></figure><p>Congrats! You’ve taken the exciting leap into the world of tech. The tech world is exciting and can get overwhelming with so much option just floating around.</p><p>Fresh out of university, you might find yourself torn between two paths. One side craves a fulfilling career that ignites your passion, while the other focuses on the practicalities of income and financial security.</p><p>So, I’ll share my experience and explain briefly about stacks in tech and how you can decide one for yourself.</p><h3><strong>Don’t Let FOMO (Fear Of Missing Out) Cripple You</strong></h3><p>As soon as I graduated, I was swept up in the MERN wave. Everyone seemed to be learning it — the “in-demand stack,” easy, lightweight, and supposedly the key to landing a job. Companies were using MERN for everything. Without much investigation, I felt the pressure to jump on the bandwagon. However, a slow realization grew on me. I was rushing into things without a clear plan. Seeing people around me landing jobs added to the anxiety.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*2pOYZTybLk05NYaGZMekug.jpeg" /></figure><p>What adds to the fear is looking at linkedin for jobs. Scrolling through endless profiles boasting years of experience in specific frameworks makes me feel like I’m behind. It’s easy to fall into the comparison trap and doubt your own skills or chosen path.</p><p>“I am excited to announce that I have accepted a job offer with .. ” is a bittersweet experience. It’s a reminder of your own job search journey, and you might wonder, “Am I doing the right things? When will it be my turn?” and the reminder can force you do stuff you don’t see yourself become in the future.</p><p>At this moment of time, Reminding yourself that things will fall into place slowly and just doing stuffs will help you a lot in the field of tech. The problem is it’s easier said than done. Having the patience to find the right spot for yourself is extremely important.</p><h3><strong>THE WORLD OF STACKS</strong></h3><p>Here let’s discuss the stacks.</p><p>Frontend, Backend, ML/AI engineer, Fullstack, Security, Mobile Deveopment, Cloud Computing and DevOps ,Data Analytics, UI/UX Design, QA and so and so. These are some main fields in tech that are in demand at the moment. So, How did I chose one? Firstly I tried to understand what each means, their scopes and perspectives as describe below:</p><ol><li>Frontend Development:</li></ol><ul><li>Be the architect of the user experience</li><li>You’ll be building the interactive elements and visual designs of websites and apps by transitioning Design into functional Interface.</li><li>Some major stacks : React (Most popular), Angular, Vue.js, Next.js(Getting extremely popular)</li><li>Required Knowledge: Coding skills along with attention to details.</li></ul><p>2. Backend Development:</p><ul><li>The mastermind behind the scenes.</li><li>You’ll be crafting server-side logic that powers the applications by handling data storage, retrieval and communicate with the frontend for full functionality.</li><li>Some major stacks: Node.js (most popular), Django (Very popular), FastApi, Spring, Ruby on rails.</li><li>Required Knowledge: Coding and building logic.</li></ul><p>3. ML/AI engineer:</p><ul><li>Teach Machines to Learn.</li><li>You’ll be involved in the process of developing algorithms along with the full process of data collection to prediction. Reading and implementing papers are pre-available models to make them work on your data based on your need is what you’ll be doing here.</li><li>You’ll mostly or almost obligatorily be using python along with many frameworks that are built for machine learning including Tensorflow, sklearn, PyTorch depending upon the need of your system.</li><li>Required Knowledge: Mathematics (stats, probability, linear algebra) and developing algorithms.</li></ul><p>4. Fullstack:</p><ul><li>The jack of all trades.</li><li>You’ll be building an entire application including Frontend, Backend, Database etc. Basically Frontend + Backend can be considered as a Full stack Web Developer.</li><li>Stacks: MERN(Most Popular), MEAN, LAMP etc</li><li>Required Knowledge: Building Logic and Coding Skills.</li></ul><p>5. Security:</p><ul><li>A Digital Guardian.</li><li>You’ll be protecting the system and data from cyberattacks by identifying vulnerability, implement security measures and preempt any evolving threats.</li><li>SIEM, UEBA, SOAR and SAP are some tools used in cybersecurity.</li><li>Required Knowledge: Understanding of security, Firewalls, best practices and cryptography</li></ul><p>6. Mobile Development:</p><ul><li>Crafting Applications for Smartphones and tablets</li><li>You’ll utilize frameworks to create a good experience for the user</li><li>Stacks: Flutter(most popular), React Native(Very Popular), Swift(iOS), kotlin</li><li>Required Knowledge: Basic Coding and understand User experince</li></ul><p>7. Cloud Computing and devops:</p><ul><li>Harness the power of cloud to act as bridge Builders.</li><li>You’ll be required to deploy applications on platforms like AWS, Azure, or GCP or any other platforms for servers and storage for on-demand services to delivery and maintenance by bridging the gap between development and operations. Automating processes,managing infrastructure and ensure applications run smoothly.</li><li>AWS, Azure, Google Cloud Platform, Golang, Docker, Kubernetes, Jenkins</li><li>Required Knowledge : Automation, Database and servers</li></ul><p>8. Data Analytics:</p><ul><li>Unlock the power of data</li><li>You’ll be required to extract insights and knowledge from data to inform business decisions. Create visualizations and see what the data mean.</li><li>Stacks : Python [ libraries like pandas, numpy, seaborn, matplotlibs ], SQL, Tableau</li><li>Required Knowledge: probability and statistics</li></ul><p>9. UI/UX design:</p><ul><li>Make it intuitive and user-friendly</li><li>You’ll need to combine creativity and design skills to create interfaces that are both beautiful and easy to navigate.</li><li>Tools : Figma, Adobe, InVision etc</li><li>Required Knowledge : Attention to detail, Color palette</li></ul><p>10. QA Engineer:</p><ul><li>Ensure the product is good</li><li>You’ll need to test and identify bugs in software applications, making sure everything functions smoothly.</li><li>Tools : Selenium, LambdaTest, Appium</li><li>Required Knowledge: Testing , Automation and knowledge of APIs</li></ul><p>I had prepared myself for Machine Learning and Backend while I was at college. My academic projects also resemble mainly these two topics, links to them are:</p><ol><li><a href="https://github.com/sanatankafle12/Used-Mobile-Price-Prediction">https://github.com/sanatankafle12/Used-Mobile-Price-Prediction</a></li><li><a href="https://github.com/sanatankafle12/Notes-and-Question-Generation">https://github.com/sanatankafle12/Notes-and-Question-Generation</a></li></ol><p>I also had grown interest in these fields which made me easier to decide my path.</p><h3><strong>So, What Fits You Good</strong></h3><p>Everything said and done, still the question remains? What should you go with then?</p><p>Let me break the ice “there is no ‘one’ stack that fits you.” There are certain factors to consider while choosing the right one at the moment .</p><ul><li>Interest — Knowing what you actually want to do takes you a long way in a job as well as life. Finding happiness in what you do is extremely important.</li><li>Market — Seeing what is currently hot pick in the market is another important aspect to consider. Learning an obsolete tech just because it interests you won’t get you anywhere.</li><li>Growth — When you chose any field you must except growth. By growth here I mean you’re learning and it’s implementation. What you become after getting into the field is extremely important.</li><li>Future — The most undermined factor when choosing a field in tech is it’s future. Having the ability and tools to preempt what in the future might explode to the scene is necessary when choosing a stack so that you’ll not be outdated.</li></ul><h3>TLDR</h3><p>As we graduate from college, we see people getting better and a self doubt arises. At this very moment it is important to calm down, take a leap back, think about stacks interest and other factors to determine what you want to do.</p><p>Just remember, success has a different meaning for everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee170cce7298" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding the Curriculum : A brief introduction to the subjects I studied as a computer engineering…]]></title>
            <link>https://medium.com/@sakafle/decoding-the-curriculum-a-brief-introduction-to-the-subjects-i-studied-as-a-computer-engineering-43c5c30003c1?source=rss-d6b6d1146f78------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c5c30003c1</guid>
            <category><![CDATA[pulchowk]]></category>
            <category><![CDATA[nepal]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[academic]]></category>
            <category><![CDATA[computer-engineering]]></category>
            <dc:creator><![CDATA[sanatan kafle]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 03:02:24 GMT</pubDate>
            <atom:updated>2024-04-15T03:02:24.598Z</atom:updated>
            <content:encoded><![CDATA[<h3>Decoding the Curriculum : A brief introduction to the subjects I studied as a computer engineering student in pulchowk</h3><p>Recently, I have completed my undergrad course in Computer Engineering in Pulchowk Campus. The journey is unlike what it looks from the outside. Here, I will only focus on the academic aspect and not my experience as a Pulchowkian.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*oESM_nrbDaEVrEie750jOw.jpeg" /></figure><p>Whether you’re considering pursuing a degree in Computer Engineering or simply seeking to expand your understanding of the field, this article will serve as a roadmap to success, showcasing the diverse subjects that shaped my educational journey.</p><p>Starting off with the basics, The course is divided into 8 semester and 4 years :</p><ul><li>First year mainly focused on providing the foundation of overall engineering</li><li>Second year focused on a generic overview of Computer Engineering</li><li>Third year had some specific learning</li><li>Fourth year pointed out ethics, code and actual implementation of computer engineering.</li></ul><p>Now, let’s delve into the subjects in each year one by one</p><p><strong>First Year First Part</strong></p><ol><li><em>Mathematics I : Offered to all the engineering faculties</em></li></ol><ul><li>Integration and its application</li><li>Derivatives and its application</li><li>Analytic Geometry</li><li>Ordinary Differential Equation and its application</li></ul><p>2<em>. Computer Programming: Offered to almost all the faculties</em></p><ul><li>Algorithm development and flowcharts</li><li>C-programming introduction</li><li>Functions, array, control statements</li><li>Pointer, Structures, File handling</li><li>FORTRAN</li></ul><p>Here, we were taught to implement fundamentals of programming using C programming. Various lab activities are also included in the course were we are required to implement patterns, functions and file handling along with other basic coding.</p><p>At the end of the course, we had to submit a simple project. My team build a simple terminal based game : Tic-Tac-Toe and Hangman where user could chose to play any game they wanted.</p><p>3<em>. Engineering Drawing I : Taught to all faculties</em></p><ul><li>Lettering</li><li>Applied Geometry</li><li>Descriptive Geometry</li><li>Orthographic Projection</li></ul><p>4<em>. Engineering Physics: Taught to all faculties</em></p><ul><li>Wave</li><li>Optics</li><li>Electromagnetic Wave</li><li>Photons</li></ul><p>5<em>. Applied Mechanics</em></p><ul><li>Beam, Frames and Trusses</li><li>Kinematics</li></ul><p>6.<em> Basic Electrical Engineering :</em></p><ul><li>Ac and Dc</li><li>Network Theorems</li><li>Single Phase AC circuit</li><li>Three Phase Circuit Analysis</li></ul><p><strong>First Year — Second Part</strong></p><ol><li><em>Mathematics II</em></li></ol><ul><li>Multiple Integrals</li><li>3D solid geometry</li><li>Differential Equations in series and Special Functions</li><li>Vector Algebra</li><li>Infinite Series</li></ul><p>2.<em> Engineering Drawing II:</em></p><ul><li>Sectional View</li><li>Pictorial Drawings</li><li>Components</li><li>Assembly Drawing</li></ul><p>3<em>. Basic Electronics Engineering:</em></p><ul><li>Basic circuits</li><li>Diode, Transistor, Amplifier and Oscillator</li><li>Communication System</li><li>Digital Electronics</li><li>Application</li></ul><p>4<em>. Engineering Chemistry:</em></p><ul><li>Buffer and electro-chemistry</li><li>Catalyst</li><li>Environment chemistry and Engineering polymers</li><li>3-d transition elements</li><li>Coordinate Complexes</li><li>Stereochemistry</li></ul><p>5<em>. Fundamental of Thermodynamics &amp; Heat Transfer :</em></p><ul><li>Energy</li><li>Laws of thermodynamics</li><li>Thermodynamic Cycles</li><li>Heat Transfer</li></ul><p>6<em>. Workshop Technology:</em></p><ul><li>Here, you are supposed to create a hammer and a dustpan. At the end of the semester, A viva session will be taken which will have generic questions to recognize machines and parts.</li></ul><p><strong>Second Year — First Part</strong></p><ol><li><em>Mathematics III :</em></li></ol><ul><li>Matrices, Integrals and laplace transform</li><li>Fourier Series</li><li>Linear Programming</li></ul><p><em>2. Object Oriented Programming:</em></p><ul><li>Intro to C++</li><li>Intro to OOP</li><li>Constructors, Objects, Classes etc</li><li>Operator Overloading</li><li>Inheritance, Polymorphism, Templates, Exception Handling</li><li>Here, We are taught the concepts of Object Oriented Programming which includes lab works regarding all the concepts. Also, At the end of semester, we had to present a project implementing OOP concepts. We implemented a Space shooter Game using C++ and SFML.</li></ul><p><em>3. Electrical Circuit Theory:</em></p><ul><li>Network Analysis of AC circuit</li><li>Transient analysis in RLC circuit</li><li>Response of parallel RLC circuit</li><li>Frequency response and Fourier series</li></ul><ol><li><em>Theory of Computation :</em></li></ol><ul><li>Finite Automata</li><li>Context Free language</li><li>Turing Machine, Undecidability</li><li>Complexity</li></ul><ol><li><em>Electronics Devices and Circuit :</em></li></ol><ul><li>Diodes, Transistor</li><li>Power Amplifiers</li><li>Signal generator</li><li>Power Supplies, Voltage regulators</li></ul><ol><li><em>Digital Logic</em></li></ol><ul><li>Gates</li><li>Combinational Logic Circuits</li><li>Flip Flops</li><li>Registers, Counters, Sequential Machines</li><li>Digital Integrate Circuits</li></ul><ol><li><em>Electromagnetism</em></li></ol><ul><li>Electric and magnetic field</li><li>Wave equation, wave guides, antennas</li><li>Transmission Lines</li></ul><p><strong>Second Year — Second Part</strong></p><ol><li><em>Electrical Machine</em></li></ol><ul><li>Magnetic Circuits</li><li>Transformer, Dc Generator, Dc Motor</li><li>3 Phase Induction Machines</li><li>3 Phase Synchronous Machines</li></ul><ol><li><em>Numerical Method</em></li></ol><ul><li>Bisection, Newton Raphson, Secant, Regula-falsi etc</li><li>Gauss Elimination, Gauss-Jordan, LU factorization, Eigen vector</li><li>Interpolation</li><li>Numerical Differentiation and Integration</li><li>Solution of ordinary differential equations</li><li>Numerical solution of Partial differential Equation</li><li>Lab Work regarding implementation of All the above learnt topics</li></ul><ol><li><em>Applied Mathematics</em></li></ol><ul><li>Complex Analysis</li><li>Z-transform</li><li>Partial Differential Equations</li><li>Fourier Transform</li></ul><ol><li><em>Instrumentation I :</em></li></ol><ul><li>Transducer</li><li>Signal Processing</li><li>ADC and DAC</li><li>Digital Instrumentation</li><li>Wattmeter, Energy meter, frequency meter.</li></ul><ol><li><em>Data Structure and Algorithm:</em></li></ol><ul><li>Stack and Queue</li><li>List and Linked list</li><li>Recursion</li><li>Trees</li><li>Sorting and Searching</li><li>Graphs</li><li>Here, We are taught implementation of data structures based on the need. We are required to complete various lab activities that includes implementation of all the data structures, Tower of Hanoi, Heap etc.</li><li>At the end of the semester, we are also required to present a project that implemented any Data structure that we learnt. Our Team presented Knights Tour and Minimum Steps by knights to move from one square to another.</li></ul><ol><li><em>Microprocessor:</em></li></ol><ul><li>Programming with 8085 and 8086 Microprocessor</li><li>Microprocessor system</li><li>Interrupts</li><li>RISC, CISC etc</li></ul><ol><li><em>Discrete Structure:</em></li></ol><ul><li>Logic and reasoning</li><li>Automata</li><li>Graph Theory</li></ul><p><strong>Third Year — First Part</strong></p><ol><li><em>Communication English:</em></li></ol><ul><li>Summary writing, report writing etc</li><li>Listening and Speaking</li></ul><ol><li><em>Probability and Statistics:</em></li></ol><ul><li>Discrete and Continuous Probability Distribution</li><li>Correlation and Regression</li><li>Inference concerning mean and proportion</li></ul><ol><li><em>Computer organization and Architecture:</em></li></ol><ul><li>CPU, Control Unit, Pipeline and Vector Processing</li><li>Computer Arithmetic</li><li>Memory System and I/O</li></ul><ol><li><em>Software Engineering:</em></li></ol><ul><li>Models, Architectural Designs</li><li>CBSE</li><li>Verification and Validation</li><li>Software testing and Configure Management</li><li>Here, We are supposed to do lab activities were we draw DFD, Use Case, Activity diagrams etc.</li><li>We are also supposed to present a project. The project is a continued activity from previous batch where we are required to understand the code and implement a feature in it. We were given Routine Management System where our seniors had implemented a Routine System Using MongoDb, React and Node. We added a teacher routine system where teacher can view their specific routine for the day as well as a generic routine.</li></ul><ol><li><em>Computer Graphic :</em></li></ol><ul><li>Scan-Conversion</li><li>2D and 3D transformation</li><li>Curve and Surface Modeling</li><li>Illumination</li><li>OpenGL</li><li>Here, We are required to perform lab activities regarding Line algorithms and 2d transformations.</li><li>At the end of the semester, A project needs to be presented. We presented a Maze room where you can move around and find the exit for the player.</li></ul><ol><li><em>Instrumentation II</em></li></ol><ul><li>Parallel and Serial Interfacing with Microprocessor Based System</li><li>Interfacing A/D and D/A</li><li>Circuit Designs</li><li>Software for Instrumentation</li><li>At the end of the semester, we are supposed to perform a case study from a local industry of our choice and understand instrumentation for power station, wire etc.</li></ul><ol><li><em>Data Communation :</em></li></ol><ul><li>Signals and Systems</li><li>Signal Analysis</li><li>Media</li><li>Data Encoding</li><li>Multiplexing and Switching</li><li>Information theory and Coding</li></ul><p><strong>Third Year — Second Part</strong></p><ol><li><em>Engineering Economics :</em></li></ol><ul><li>Interest and Time value of Money</li><li>Comparative Analysis of Alternatives</li><li>Replacement and Risk Analysis</li><li>Inflation</li></ul><ol><li><em>Object Oriented Analysis and Design:</em></li></ol><ul><li>Fundamentals, Analysis and Design</li><li>Mapping the Design to code</li><li>Lab activities regarding UML designs</li><li>At the end of the semester, we are required to submit a comprehensive report with UML diagrams on our Minor Project.</li></ul><ol><li><em>Artificial Intelligence :</em></li></ol><ul><li>Problem Solving</li><li>Searching techniques</li><li>Knowledge representation, inference and reasoning</li><li>ML</li><li>NN, Expert Systems, Knowledge Base</li><li>Using Prolog and Python, We implement fundamentals of searching, question answering, inference and reasoning</li><li>At the end of the semester, we need to present a project which will implement any AI topics. We implemented an extractive summarization . Some other topics that our friends implemented are:</li><li>Fuzzy Logic</li><li>Tic-Tac-Toe using Alpha beta pruning</li><li>Genetic Algorithms etc</li></ul><ol><li><em>Operating System:</em></li></ol><ul><li>Process and Memory Management</li><li>File Systems</li><li>I/O and Disk Scheduling</li><li>Deadlock and Security</li><li>Lab work regarding shell programming, Basic Linux commands, Memory Management and implementation of Producer-Consumer Problems</li></ul><ol><li><em>Embedded System:</em></li></ol><ul><li>Hardware and Software Design Issues</li><li>Memory and Interfacing</li><li>Real Time Operating System</li><li>Control System and IC technology</li><li>Microcontrollers and VHDL</li></ul><ol><li><em>Database Management System:</em></li></ol><ul><li>Data Models</li><li>SQL</li><li>Normalization, Query handling and File structure</li><li>Concurrency Control and Crash Recovery</li><li>Lab work regarding MySQL operations.</li><li>Project including major part regarding Database handling. We were given the same project implemented in Software Engineering [Routine Management] where we implemented Teacher’s Database using Mongodb</li></ul><ol><li><em>Minor Project</em></li></ol><ul><li>In pulchowk campus, there was a collaboration of Samsung Innovation Campus with Minor Project where we were taught basis of programming and at the end of the course, we had to implemented the learned topic and create a project. My team implemented a model to predict price of used smart phone using Regression techniques. Some other projects are:</li><li>Online Examination Platform</li><li>Parking guide to see available parking space</li><li>Resume builder</li><li>Travel Buddy etc</li></ul><p><strong>Fourth Year — First Part</strong></p><ol><li><em>ICT Project Management:</em></li></ol><ul><li>Portfolio Management</li><li>Project Management</li><li>Time, Integration, Process, Cost, Quality, Communication, Risk and Procurement Management</li></ul><ol><li><em>Organization and Management:</em></li></ol><ul><li>Personal Management</li><li>Motivation and Leadership</li><li>MIS</li><li>A case study regarding how companies handle employees and it’s operation was done. We studied Delivery hero which is a Germany based food delivery app</li></ul><ol><li><em>Energy Environment and Society:</em></li><li><em>Distributed System:</em></li></ol><ul><li>Distributed Objects and File System</li><li>Distributed Heterogeneous Applications and CORBA</li><li>Time and State in Distributed Systems</li><li>Replication and Fault Tolerance</li></ul><ol><li><em>Computer Networks and Security:</em></li></ol><ul><li>Layers of OSI</li><li>IPV6</li><li>Network Security</li><li>Lab activity regarding LAN setup, Router Config, VLAN, DNS, DHCP etc</li><li>At the end of semester, we presented a report on a real world implementation of computer network with was designed using CISCO.</li></ul><ol><li><em>Digital Signal Analysis and Processing:</em></li></ol><ul><li>Z-transform</li><li>LTI analysis</li><li>Filters — IIR and FIR</li><li>Fourier Transform</li><li>Lab works regarding Signal generation, Convolution and Filters</li></ul><ol><li>Elective I:</li></ol><ul><li>Data Mining</li><li>Web Development</li><li>Advanced Java</li><li>IT innovation</li><li>Applied Data Science [Only in pulchowk and was only implemented in our batch as collaboration with Samsung Innovation Compus]</li></ul><p>→ I chose ADS where we were taught all the fundamentals of AI and ML. It was almost completely lab oriented at the end of which we were required to submit a project.</p><ol><li><a href="https://aihubprojects.com/category/latest-ai-project-codes/">Project I</a> → A major project has to be done as a part of computer engineering course. My team implemented a Automatic Note and Mcq Generation using T5 transformer. Some other project ideas that my friends implemented are :</li></ol><ul><li>Virtual Tryon — Try cloths on your body</li><li>A comprehensive job platform with applicant ranking</li><li>Topic Modelling</li><li>Image description etc</li></ul><p><a href="http://www.ioenotes.edu.np/tag/bct-iv-ii-syllabus"><strong>Fourth Year — Second Part Syllabus</strong></a></p><ol><li><em>Engineering Professional Practice:</em></li></ol><ul><li>Profession, Ethics</li><li>Contract, Regulation, Contemporary Issues</li></ul><ol><li><em>Information System:</em></li></ol><ul><li>Audit, Control and Security</li><li>EMS, DSS</li><li>Planning</li><li>Web Based IS</li><li>Scalable IS</li></ul><ol><li><em>Internet and Intranet:</em></li></ol><ul><li>Protocols and Client Server Applications</li><li>HTTP</li><li>Internet System and Servers</li><li>Applications</li><li>Lab regarding Web programming Skill, DB connection and Site development</li><li>At the end of the semester, implementation of logical Diagram of a real world system.</li></ul><ol><li><em>Simulation and Modeling:</em></li></ol><ul><li>Physical and Mathematical Models</li><li>Continuous System Simulation</li><li>Queuing Systems and Markov Chains</li><li>Random Number Generator</li><li>Verification, Validation, Analysis of output, software</li><li>Lab works regarding Simulation, RC and Random Number.</li></ul><ol><li><em>Elective II:</em></li></ol><ul><li>Big Data [chosen] — MapReduce, Hadoop, DFS etc.</li><li>Softwarization</li></ul><ol><li><em>Elective III:</em></li></ol><ul><li>Multimedia[Chosen]</li><li>Security</li><li>DataWarehouse</li></ul><ol><li><em>Project II</em> → Continued from the previous project</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c5c30003c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>