Skip to content

Instantly share code, notes, and snippets.

View yanndebray's full-sized avatar
🤖
vibing

Yann Debray yanndebray

🤖
vibing
View GitHub Profile

Yann: classify image called 'cat-mike.png' with pretrained network

Copilot: To classify an image called cat-mike.png using a pretrained network in MATLAB, you can use the following code snippet with the Deep Learning Toolbox. This example utilizes the GoogLeNet model, which is pretrained on the ImageNet dataset.

% Load the pretrained GoogLeNet network
[net, classNames] = imagePretrainedNetwork("googlenet");

Codex Agent Instructions for MATLAB Toolbox Design

Objective

This repository documents best practices for building MATLAB® toolboxes. The AGENTS.md file outlines a set of actionable instructions for a Codex‑powered agent responsible for generating and maintaining a toolbox that conforms to these practices. The goal is to ensure that any automatically generated toolbox is easy for users to install, understand, and contribute to, and that it follows MathWorks’ guidelines for structure, packaging, testing, and release.


1. Root folder configuration

function MassSpringDamperSimulator()
% Mass Spring Damper Simulator (1-DOF)
% Interactive simulation with base excitation
% Replicates the web-based simulator functionality
% Create figure
fig = figure('Name', 'Mass Spring Damper Simulator (1-DOF)', ...
'NumberTitle', 'off', ...
'Position', [100, 100, 1400, 800], ...
'Color', [0.95, 0.95, 0.98]);
% % Install uv
!curl -LsSf https://astral.sh/uv/install.sh | sh
% % Set up uv
% 1) Point PATH to where uv was installed
setenv('PATH', getenv('HOME')+"/.local/bin:"+getenv('PATH'));
% Sanity checks
system('which uv'); % should print ~/.local/bin/uv
system('uv --version');
system('python --version');
session = pyrun("import fastf1; session = fastf1.get_session(2023, 1, 'R'); session.load(telemetry=False, weather=False)","session")
drv = session.drivers;
%% Figure / axes (dark theme similar to FastF1)
figure('Color',[0.08 0.09 0.10],'Position',[100 100 900 500]);
ax = axes('Parent', gcf);
set(ax,'Color',[0.08 0.09 0.10],'XColor',[0.85 0.88 0.90], ...
'YColor',[0.85 0.88 0.90],'Box','off','LineWidth',1);
hold(ax,'on'); grid(ax,'on'); ax.GridColor=[0.25 0.28 0.30];
%[text] # demucs with uv onlinedemucs
%[text:tableOfContents]{"heading":"**Table of Contents**"}
%[text]
%%
%[text] ### Install uv
!curl -LsSf https://astral.sh/uv/install.sh | sh %[output:09e95903]
%%
%[text] ### Set up uv
% 1) Point PATH to where uv was installed
setenv('PATH', [getenv('HOME') '/.local/bin:' getenv('PATH')]);
#!/usr/bin/env python3
"""
Create a PowerPoint deck from a folder of images, widescreen (16:9).
Usage:
python make_ppt.py --images slides/ --out slides.pptx
"""
import argparse
from pathlib import Path
#!/usr/bin/env python3
"""
Extract distinct slides from a presentation video.
Usage:
python extract_slides.py --video input.mp4 --out slides/ --interval 10 --threshold 6
Args:
--video Path to the input video file.
--out Output folder for saved images (created if missing).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.