You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-5
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,27 @@ The [wiki](https://github.com/multi-template-matching/MultiTemplateMatching-Pyth
31
31
The [website](https://multi-template-matching.github.io/Multi-Template-Matching/) of the project contains some more general documentation.
32
32
33
33
# Tips and tricks
34
+
35
+
-`matchTemplates` expects for the template a list of tuples with one tuple per template in the form (a string identifier for the template, array for the template image). You can generate such list of tuples, from separate lists of the label and template images as following
36
+
37
+
```python
38
+
listLabel = [] # this one should have the string identifier for each template
39
+
listTemplate = [] # this one should have the image array for each template, both list should have the same length
40
+
listTemplateTuple =zip(listLabel, listTemplate)
41
+
```
42
+
43
+
Similarly, from the list of hits returned by matchTemplates (or NMS), you can get individual lists for the label, bounding-boxes and scores, using `listLabel, listBbox, listScore = zip(*listHit)`
44
+
34
45
- To have a nicer formatting when printing the list of detected hits, you can wrap it into a numpy array, and print that array as following
35
46
`print(np.array(listHit, dtype=object))`, the `dtype=object` argument is required as each hit in the list is made of different data type (string, tuple and float)
36
47
37
-
- Before version 2.0.0, most functions were returning or accepting pandas DataFrame for the list of hit.
38
-
You can still get such DataFrame from the list of hit returned by the newer version of the package, using these commands
48
+
- Before version 2.0.0, most functions were returning or accepting pandas DataFrame for the list of hit.
49
+
You can still get such DataFrame from the list of hits returned by MTM v2.0.0 and later, using the command below
You can also stick to previous version of MTM by specifying the version to pip install, or in a requirements.txt or environment.yml
64
+
`pip install "Multi-Template-Matching < 2.0.0"
65
+
54
66
# Examples
55
67
Check out the [jupyter notebook tutorial](https://github.com/multi-template-matching/MultiTemplateMatching-Python/tree/master/tutorials) for some example of how to use the package.
56
68
You can run the tutorials online using Binder, no configuration needed ! (click the Binder banner on top of this page).
0 commit comments