@@ -13,7 +13,7 @@ group pictures, screenshots, etc...
1313
1414In a Python 3.8+ virtual environment, install either from PIP or from source:
1515
16- ####Installation from the PIP package:
16+ ####  Installation from the PIP package:  
1717``` bash 
1818pip install image-searcher
1919
@@ -41,22 +41,29 @@ the picture, enable the `include_faces` flag (note that it makes the indexing pr
4141``` python 
4242from  image_searcher import  Search
4343
44- searcher =  Search(image_dir_path = " /home/manu/perso/ImageSearcher/data/"  , traverse = True , include_faces = False )
44+ searcher =  Search(image_dir_path = " /home/manu/perso/ImageSearcher/data/"  , 
45+                   traverse = True , 
46+                   include_faces = False )
4547``` 
4648
4749Once this process has been done once, through Python, the library is used as such:
4850``` python 
4951from  image_searcher import  Search
5052
51- searcher =  Search(image_dir_path = " /home/manu/perso/ImageSearcher/data/"  , traverse = True , include_faces = False )
53+ searcher =  Search(image_dir_path = " /home/manu/perso/ImageSearcher/data/"  , 
54+                   traverse = True , 
55+                   include_faces = False )
5256
53- ranked_images =  searcher.rank_images(" A photo of a bird."  , n = 5 )
54- 
55- #  Display best images
57+ #  Option 1: Pythonic API
5658from  PIL  import  Image
5759
60+ ranked_images =  searcher.rank_images(" A photo of a bird."  , n = 5 )
5861for  image in  ranked_images:
5962    Image.open(image.image_path).convert(' RGB'  ).show()
63+ 
64+ #  Option 2: Launch Flask api from code
65+ from  image_searcher.api import  run
66+ run(searcher = searcher)
6067``` 
6168
6269### Using tags in the query  
@@ -93,7 +100,15 @@ threaded:
93100` ` ` python 
94101from image_searcher.api import run 
95102
103+ #  Option 1: Through a config file
96104run(config_path="path_to_config_file.yml") 
105+ 
106+ #  Option 2: Through an instanciated Search object
107+ from image_searcher import Search 
108+ 
109+ run(searcher=Search(image_dir_path="/home/manu/perso/ImageSearcher/data/",  
110+                     traverse=True,  
111+                     include_faces=False)) 
97112``` 
98113
99114A gunicorn process can also be launched locally with:
0 commit comments