Package: segmentation-evaluation
Segmentation Evaluation ToolThis tool has two main characteristics:manually segment an image in order to create theground truthevaluate a segmentation through a ground truth in terms ofrecallandprecisionThe documentation is reachable through thatlink.Table of ContentInstallationUsageSegmentationEvaluationVersionCreditsLicenseInstallationUsepipto install the tool:pipinstallsegmentation-evaluationUsageIn order to use the tool, open the terminal and digitsegmentation-evaluation:$segmentation-evaluationAfter that a printed menu is shown:PERFORMANCE TOOLPress 1 to manually segment the imagePress 2 to evaluate programmatically segmentationIn order to exit from the menu pressctrl + c.SegmentationChoosing1from the menu, the segmentation mode is activated.After inserted theabsolute pathof the image and the *absolute pathof the folder in which save the results, a window that shows the required image is displayed.In order to insert a pointDOUBLE CLICKin the desired position.A green point is displayed. Then, inserting another point the segment between the two points is displayed.After the third insertion of a point a polygon in which vertexes are the points is shown.A pointA lineA polygon with 3 vertexeswith 4 vertexesIn addition to inserting new points it is possible to perform several action inserting a specific char while theimage window is shown.The possible actions are:CharActionuUndo last inserted pointcClear all inserted points (not removes the already saved polygons)sSave points and go to execution to insert labelqTerminate the insertionOnce the saving action is a pop up message asks to return to the terminal window where it is possible to insert the label associated to the polygon.Then a printed string asks to come back to the image window to insert new polygons.If you don't want to insert new polygon, come back to the image window and typeq. A window shows all objects inserted associated to the label and typing againqthe execution will terminate.EvaluationIn order to perform the evaluation 3 paths need provided:path to the JSON file representing the correct segmentation, the ground truthpath to the JSON file representing the segmentation to evaluatepath to the folder in which save the evaluationThe evaluation is performed computing the recall and precision values.
In order to consider a match good, the object has to satisfy an intersection over the union greater or equal than 80%.The results are saved into a json file containing several values, the associated key is the label matched in both json files as input.
In addition a final value that collects overall parameters associated to the keyoverall_performance.Each item of the dictionary is another dictionary containing these keys:"n_good_match": number of polygons matched between the two json files"n_correct": number of polygons present in the ground truth"n_found": number of polygons present in the segmentation to evaluate"recall": n_good_match / n_correct"precision": n_good_match / n_foundNB: the structure of the inputted json must be compliant with the following structure:{"0":{"label":"name","points":[[803,1138],[980,1167],[972,1370],[797,1331]]},"1":{"label":"","points":[]}}The main keys is an incremental value that identify uniquely the polygon.Each polygon must contain a key"label"with the name (as string) and"points"that has a list as value, the list contains the vertexes of the polygon. Each vertex is a point represented by a list or a tuple of the (x, y) coordinate.Version1.0: first releaseCreditsThe tool was written by:Mattia SanchioniAlessandro ConcettiLicenseThis project is under the GPL-3.0 license - see theLICENSE.mdfile for more details