Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FerrumPix Models

This repository is a place to keep files. It contains no original work of its own, only files from other projects: model files converted to ONNX so that FerrumPix can run them without Python, plus one plain lookup table.

Licences

There is no single licence covering this repository. Every file carries the licence of the project it came from:

File Origin Licence Notices
mobilesam-encoder-v1.onnx MobileSAM Apache-2.0 licenses/LICENSE.Apache-2.0.txt, licenses/NOTICE-mobilesam.txt
mobilesam-decoder-v1.onnx MobileSAM Apache-2.0 the same two
midas-small-v1.onnx MiDaS MIT licenses/LICENSE.MIT.midas.txt, licenses/NOTICE-midas.txt
lama-v1.onnx LaMa Apache-2.0 licenses/LICENSE.Apache-2.0.txt, licenses/NOTICE-lama.txt
yunet-v1.onnx OpenCV Model Zoo MIT licenses/LICENSE.MIT.yunet.txt, licenses/NOTICE-yunet.txt
arcface-r100-v1.onnx ONNX Model Zoo Apache-2.0 licenses/LICENSE.Apache-2.0.txt, licenses/NOTICE-arcface.txt
orte-v1.sqlite GeoNames CC BY 4.0 licenses/LICENSE.CC-BY-4.0.txt, licenses/NOTICE-orte.txt

The two people files come from different collections and not under the same licence: yunet-v1.onnx is MIT from the OpenCV Model Zoo, arcface-r100-v1.onnx is Apache-2.0 from the ONNX Model Zoo. Whoever passes them on ships both texts. YuNet itself grew out of libfacedetection; ArcFace comes from the paper ArcFace: Additive Angular Margin Loss for Deep Face Recognition, with the ONNX conversion published in the ONNX Model Zoo.

MobileSAM builds on Segment Anything by Meta Platforms and on TinyViT by Microsoft. Both copyright notices are reproduced in the notice file.

LaMa's weights are the "big-lama" checkpoint the upstream README names as its own download. The notice file records the full chain: original project, weights, and the ONNX export this copy came from.

All three licences permit redistribution. Whoever passes one of these files on has to pass on its licence text and its copyright notices with it - CC BY additionally requires the source to be named. That is why the licenses folder belongs to every release, not just to the source tree.

What was changed

The weights were exported to ONNX unchanged, without retraining and without altering anything about the weights themselves. Each notice file records how its file was produced, and where.

The place table was converted from the GeoNames text dumps into SQLite and cut down to the fields needed for the lookup. No place was added, removed or altered.

lama-v1.onnx is a half-precision export: only the convolution weights are stored as float16, with a cast in front of each. Input and output stay float32 and the arithmetic is done in float32, so nothing has to be converted by the caller.

Apache-2.0 requires changes to be stated. Converting the file format is one, so it is stated here and in the notice files.

Checksums

SHA256SUMS.txt accompanies every release. FerrumPix carries the same checksums inside the application and verifies every file it fetches against them. A checksum that travelled with the file would be supplied by the same attacker who supplied the file.

Installing by hand

The usual way is the button in the FerrumPix settings, under Technology. Anyone who would rather place the files themselves - on a machine without a network connection, for instance - puts them here:

System Folder
Linux ~/.config/FerrumPix/Modelle
Windows %APPDATA%\FerrumPix\Modelle
macOS ~/Library/Application Support/FerrumPix/Modelle

A Modelle folder next to the application and /usr/share/ferrumpix/modelle are searched as well. Whatever sits in the user's own folder wins.

The file names have to stay as they are - FerrumPix looks for them by name and checks their checksum.

What is needed for what

Feature Files Together
Select an object by clicking it (mask tool) mobilesam-encoder-v1.onnx, mobilesam-decoder-v1.onnx 42 MiB
Depth mask and depth blur midas-small-v1.onnx 63 MiB
Remove an object lama-v1.onnx 105 MiB
Find people and group them yunet-v1.onnx, arcface-r100-v1.onnx 249 MiB
Name the place a photo was taken orte-v1.sqlite 12 MiB

They are independent of one another: if you only want the object selection, fetch only its two files. When a piece is missing, the matching controls in FerrumPix are not there - not greyed out, gone.

The two people files only work as a pair. YuNet finds the faces - where they are, plus the five points the alignment rests on - and ArcFace turns one aligned face into a row of 512 numbers that can be compared. ArcFace cannot search: without YuNet there would be nothing to hand it. With YuNet alone you would know that somebody is in the picture, never whether it is the same person as next door. Neither of them knows who anyone is - names are yours to give.

The size is lopsided on purpose: finding faces costs 227 KiB, telling them apart costs 249 MiB. That is where the difficulty sits.

orte-v1.sqlite is the odd one out: not a learned model but a lookup table of 170540 places with their coordinates, derived from the GeoNames dataset. It answers a single question - which place is nearest to this point - and it answers it locally, so photo positions never leave the machine. It knows places, not streets or addresses, and a photo out at sea deliberately gets no name: the nearest entry would be a thousand kilometres away.

Everything runs on your own machine. Nothing is transmitted to anyone, and FerrumPix never fetches anything by itself.

Versions

The version is part of the file name. A file that already sits on the machine stays valid and FerrumPix keeps working with it until someone asks for the update.

What matters for that is the contract - the inputs, their shapes and their value ranges. Where a file keeps its name, the checksum is what tells one build apart from another, and FerrumPix checks it: a copy that does not match the checksum in the application is fetched again rather than used. Where the contract itself changes, the file gets a new name. Faces are the one place where a change is felt in the library as well: the rows of numbers only ever compare against rows from the same model, so a library scanned with a different one has to be scanned once more.

About

Model files for the object selection and depth features of FerrumPix

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors