Finding Pre-Trained AI In A Modelzoo Using Python

Training a machine learning model is not a task for mere mortals, as it takes a lot of time or computing power to do so. Fortunately there are pre-trained models out there that one can use, and [Max Bridgland] decided it would be a good idea to write a python module to find and view such models using the command line.

For the uninitiated, Modelzoo is a place where you can find open source deep learning code and pre-trained models. [Max] taps into the (undocumented) API and allows a user to find and view models directly. When you run a utility, it goes online and retrieves the categories and then details of the available models. From then on, the user can select a model and the application will simply open the corresponding GitHub repository. Sounds simple but it has a lot of value since the code is designed to be extendable so that users working on such projects may automate the downloading part as well.

We have seen projects with machine learning used to detect humans, and with AI trending community tools such as this one help beginners get started even faster.

RPi Tank Invades Living Room, Teaches OpenCV

If you’re looking for a simple project to start exploring the intersection of OpenCV and robotics, then the RPi Tank created by [Vishal Varghese] might be a good place to start. A Raspberry Pi and a few bits of ancillary hardware literally taped to the top of a toy M1 Abrams tank becomes a low-cost platform for testing out concepts such as network remote control and visual line following. Sure, you don’t need to base it around an Abrams tank, but if you’re going to do it you might as well do it with style.

As this is more of a tech demonstrator, the hardware details are pretty minimal. [Vishal] says you just need a relatively recent version of the Raspberry Pi, a MotoZero motor controller, and a camera module. To provide juice for the electronics you don’t need anything more exotic than a USB power bank, which in his case has been conveniently attached to the top of the turret. He doesn’t provide exact details on how the MotoZero gets wired into the Abram’s motors, but we imagine it’s straightforward enough that the average Hackaday reader probably doesn’t need it spelled out for them.

Ultimately, the software is the heart of this project, and that’s where [Vishal] really delivers. He’s provided sample Python scripts ordered by their level of complexity, from establishing a network connection on the Raspberry Pi to following a line of tape on the ground. Whether used together or examined individually, these scripts provide a great framework to get your first project rolling. Literally.

Line following robots, in their many forms, have been a favorite hacker project for years. Whether they home in with an analog circuit or replace the lines with hidden wires, they’re a great way to get started with semi-autonomous robotics.

Analog Gauges Keep An Eye On Computer Performance

Keeping an eye on your computer’s resource utilization can be useful, particularly if you’re regularly doing computationally intensive tasks. While it’s entirely possible to achieve this with software tools, creating a dedicated hardware monitor can be cool too. [Sasa Karanovic] did just that, with a set of old-school analog gauges.

The build uses an STM32 microcontroller to drive a series of four galvanometers through an MCP4728 digital-to-analog converter. Data on CPU, memory, network and GPU utilization is collected by a Python script, and sent over a USB serial connection. This data drives the four-channel DAC, which in turn creates the voltages which control the needle position on the gauges. Aesthetically, the build features a few nice touches, including custom gauge faces and a 3D printed enclosure with a tasteful matte finish. A custom PCB keeps the electronics and wiring neat and tidy.

[Sasa] does a great job of explaining the basic theory of the device, as well as practical considerations for working with galvanometer-based gauges. It would make a great weekend project for anyone seeking to add some vintage charm to their desktop rig. There’s also scope to monitor other variables, like hard drive usage or CPU temperature. There’s bonus points if you integrate this into a laptop; the tip line would love to know. We’ve seen LED-based monitoring systems before, too. Video after the break.

Continue reading “Analog Gauges Keep An Eye On Computer Performance”

What’s In A Name? Tales Of Python, Perl, And The GIMP

In the older days of open source software, major projects tended to have their Benevolent Dictators For Life who made all the final decisions, and some mature projects still operate that way. Guido van Rossum famously called his language “Python” because he liked the British comics of the same name. That’s the sort of thing that only a single developer can get away with.

However, in these modern times of GitHub, GitLab, and other collaboration platforms, community-driven decision making has become a more and more common phenomenon, shifting software development towards democracy. People begin to think of themselves as “Python programmers” or “GIMP users” and the name of the project fuses irrevocably with their identity.

What happens when software projects fork, develop apart, or otherwise change significantly? Obviously, to prevent confusion, they get a new name, and all of those “Perl Monks” need to become “Raku Monks”.  Needless to say, what should be a trivial detail — what we’ve all decided to call this pile of ones and zeros or language constructs — can become a big deal. Don’t believe us? Here are the stories of renaming Python, Perl, and the GIMP.

Continue reading “What’s In A Name? Tales Of Python, Perl, And The GIMP”

Sensor Filters For Coders

Anybody interested in building their own robot, sending spacecraft to the moon, or launching inter-continental ballistic missiles should have at least some basic filter options in their toolkit, otherwise the robot will likely wobble about erratically and the missile will miss it’s target.

What is a filter anyway? In practical terms, the filter should smooth out erratic sensor data with as little time lag, or ‘error lag’ as possible. In the case of the missile, it could travel nice and smoothly through the air, but miss it’s target because the positional data is getting processed ‘too late’. The simplest filter, that many of us will have already used, is to pause our code, take about 10 quick readings from our sensor and then calculate the mean by dividing by 10. Incredibly simple and effective as long as our machine or process is not time sensitive – perfect for a weather station temperature sensor, although wind direction is slightly more complicated. A wind vane is actually an example of a good sensor giving ‘noisy’ readings: not that the sensor itself is noisy, but that wind is inherently gusty and is constantly changing direction.

It’s a really good idea to try and model our data on some kind of computer running software that will print out graphs – I chose the Raspberry Pi and installed Jupyter Notebook running Python 3.

The photo on the left shows my test rig. There’s a PT100 probe with it’s MAX31865 break-out board, a Dallas DS18B20 and a DHT22. The shield on the Pi is a GPS shield which is currently not used. If you don’t want the hassle of setting up these probes there’s a Jupyter Notebook file that can also use the internal temp sensor in the Raspberry Pi. It’s incredibly quick and easy to get up and running.

It’s quite interesting to see the performance of the different sensors, but I quickly ended up completely mangling the data from the DS18B20 by artificially adding randomly generated noise and some very nasty data spikes to really punish the filters as much as possible. Getting the temperature data to change rapidly was effected by putting a small piece of frozen Bockwurst on top of the DS18B20 and then removing it again.

Continue reading “Sensor Filters For Coders”

Process Characterization On The Cheap With A Custom Test Rig

Testing is a key part of any product development cycle. Done right, it turns up unknown bugs and problems, and allows for them to be fixed prior to shipment. However, it can be a costly and time-consuming process. The [Bay Libre] team needed to do some work on power management, but the hardware required was just a little on the expensive side. What else does a hacker do, but build their own?

Enter the Thermo-Regulated Power Measurement Platform. It’s a device designed to control the die temperature of a chip during process characterization. This is where a chip, in this case the iMX8MQ, is run at a variety of temperatures, voltages, and frequencies to determine its performance under various conditions. This data guides the parameters used to run the chip in actual use, to best manage its power consumption and thermal performance.

The rig consists of a Peltier element with controller, a heatsink, and a fan. This is lashed up to a series of Python scripts that both control the chip temperature and run through the various testing regimes. Thanks to this automation, what would normally be a day’s work for an engineer can now be completed in just two hours.

Through a few smart component choices, the team accomplished the job at around one-tenth of the cost of commercial grade hardware. Granted, the average hacker probably won’t find themselves doing process characterization for cutting-edge silicon on a regular basis. Still, this project shows the value in building custom hardware to ease the testing process.

Testing is key to success in production. Custom jigs can make for light work when large orders come in, and we’ve run a primer on various testing techniques, too.

Micropython And C Play Together Better

Python is a versatile, powerful language but sometimes it’s not the best choice, especially if you’re doing work in embedded systems with limited memory. Sometimes you can get away with MicroPython for these cases, but the best language is likely C or assembly. If you’re really stubborn, like [amirgon], and really want C and Python to play well together, you can make use of his new tool which can bring any C library to MicroPython.

As an example of how this tool is used, a “Pure MicroPython” display driver for ILI9341 on the ESP32, which means that everything was implemented in MicroPython. [amirgon] wanted to see how the Python driver would compare to one that’s already been written in C, and use it to showcase MicroPython binding. This tool also automatically converts structs, unions, enums and arrays to Python objects, and provides a means to work with pointers which is something that Python doesn’t handle in the same way that C requires.

[amirgon] hopes that this tool will encourage the adoption of Micropython by removing the obstacle of missing APIs and libraries in MicroPython. Since most libraries for systems like these are written in C, a way to implement them in Python is certainly powerful. We featured one use case for this a while back, but this is a much more generic fix for this coding obstacle.