Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/univr-VIPS/Shrec22
20 May 2025, 19:53:07 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 285b56b
  • /
  • evaluation_shrec22fix.m
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:6304f41f53c9e0d01ffb326fa5b4fac1d0623b18
origin badgedirectory badge Iframe embedding
swh:1:dir:285b56b9e2f0f898274bc8c61c70e0889cdb158e
origin badgerevision badge
swh:1:rev:e2bbcc0280df2de07811e7154f5c89624b0e19b6
origin badgesnapshot badge
swh:1:snp:373fe8ea8595496b3e2b55877167cd14337dca31
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: e2bbcc0280df2de07811e7154f5c89624b0e19b6 authored by ArielCaputo on 27 July 2022, 17:17:07 UTC
replaced old files
Tip revision: e2bbcc0
evaluation_shrec22fix.m
clear all;
max_dim_ratio = 2;
min_overlap_ratio = 0.5;

labels = {"ONE"; "TWO"; "THREE"; "FOUR"; "OK"; "MENU"; "LEFT"; "RIGHT"; "CIRCLE"; "V"; "CROSS"; "GRAB"; "PINCH";"DENY";"WAVE";"KNOB";};

A = {}; %line with the original annotations for one sequence looped in the for
R = {}; %line with the submitted result annotations for one sequence looped in the for

A_file = fopen('test_annotations_fixed.txt'); %<<-- Change this file name with the file you want to use as GT 
R_file = fopen('your_results_file.txt'); %<<-- Change this file name with the file you want evaluate

Raw_Results = [labels,cell(16,1)];
for (i = 1:16) Raw_Results{i,2} = zeros(1,5); end
%Format [label, [total, correct, missed, FP, Delay]]

for line=1:144
    A_line = fgetl(A_file); R_line = fgetl(R_file);   %Fetching one line from both files
    A = split(A_line,';',2); R = split(R_line,';',2); %Splitting along the separator character
    
    for gA = 2:3:size(A,2)-1 %Verifying GT file consistency. The first column in the 2nd cell of each row of Raw_results should be 36
        AA = A(gA:gA+2); %Fetching the single gestures in the annotations sequence
        label_A = AA{1}; start_A = str2double(AA{2}); end_A = str2double(AA{3});
        ind = find([labels{:}] == label_A);
        Raw_Results{ind,2}(1,1) = Raw_Results{ind,2}(1,1)+1; %Increase the count at the relative cell for the total count/check 
    end

    found = false;
    for gR = 2:4:size(R,2)-1
        RR = R(gR:gR+2); %Fetching the single gestures in the results sequence
        label_R = RR{1}; start_R = str2double(RR{2}); end_R = str2double(RR{3});
        for gA = 2:3:size(A,2)-1
            AA = A(gA:gA+2); %Fetching the single gestures in the annotations sequence
            label_A = AA{1}; start_A = str2double(AA{2}); end_A = str2double(AA{3});
            if (found == false)
                if (strcmp(label_A,label_R)) %Check if the label 
                    if (end_R-start_R <= (end_A-start_A)*max_dim_ratio) %Checking if the gesture in the result is within the maximum dimention limits
                        if((min([end_A, end_R])-max([start_A, start_R]))/(end_A-start_A)>= min_overlap_ratio) %Checking if the overlap between the gesture in the result and the annotated one is bigger than the min overlap ratio
                            %In this case it's a correct detection
                            A(gA:gA+2) = [{'-'},{0},{0}]; %We blank the entry out from A to avoid multiple correct detection
                            ind = find([labels{:}] == label_A);
                            Raw_Results{ind,2}(1,2) = Raw_Results{ind,2}(1,2)+1; %Increase the count at the relative cell
                            Raw_Results{ind,2}(1,5) = Raw_Results{ind,2}(1,5)+minus(str2double(R{gR+3}),str2double(R{gR+1})); %We add the delay as the subtraction the third number and the first, to be avaraged later
                            found = true;
                        else
                            if((min([end_A, end_R])-max([start_A, start_R]))/(end_A-start_A)>0)
                                label_R = '';
                            end
                        end
                    end
                end
            end
        end
        if (found == false)
            %We checked all the gestures in the annotations and no match
            %was found so we classify this as FP
            ind = find([labels{:}] == label_R);
            if (~isempty(ind))
                Raw_Results{ind,2}(1,4) = Raw_Results{ind,2}(1,4)+1; %Increase the count at the relative cell
            end
        end

        found = false; %Reset the variable for the next loop

    end
    for gA = 2:3:size(A,2)-1
        %We check which labels in the sequence have not been blanked out
        %we consider those "missed"
        ind = find([labels{:}] == A{gA});
        if (~isempty(ind))
            Raw_Results{ind,2}(1,3) = Raw_Results{ind,2}(1,3)+1; %Increase the count at the relative cell
        end
    end

end

tmp = cell2mat(Raw_Results(1:16,2));
for d = 1:16
    if tmp(d,2) > 0
        tmp(d,5) = tmp(d,5)/tmp(d,2);
    else
        tmp(d,5) = nan;
    end
end

Compact_Results = zeros(17,4); 
Compact_Results(1:16,1) = tmp(1:16,2)./tmp(1:16,1); %Detection Rate(per class) = Correct(per class) / Total (per class)
Compact_Results(17,1) = sum(Compact_Results(1:16,1))/16;
Compact_Results(1:16,2) = tmp(1:16,4)./tmp(1:16,1); %FP Rate(per class) = FP(per class) / Total(per class)
Compact_Results(17,2) = sum(Compact_Results(1:16,2))/16;
Compact_Results(1:16,3) = tmp(1:16,2)./(tmp(1:16,2)+tmp(1:16,3)+tmp(1:16,4));  %Jaccard Index(per class) = Correct(per class) / (Correct(per class) + missed(per class) + FP(per class))
Compact_Results(17,3) = sum(Compact_Results(1:16,3))/16;
Compact_Results(1:16,4) = tmp(1:16,5);%./tmp(1:16,2); %We avarage the delay by the number of gestures for which we recorded a delay
Compact_Results(17,4) = nansum(Compact_Results(1:16,4))/16;

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top