Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zeozeozeo/imgsearch

Small image search engine written in Go, HTML and CSS
https://github.com/zeozeozeo/imgsearch

gin golang image search search-engine website

Last synced: 18 days ago
JSON representation

Small image search engine written in Go, HTML and CSS

Awesome Lists containing this project

README

        

# an image search engine in Go

This is a very basic image search engine website based on my other library, [imagesim](https://github.com/zeozeozeo/imagesim). It uses the [Gin](https://github.com/gin-gonic/gin) HTTP framework.

![landing](https://github.com/zeozeozeo/imgsearch/blob/main/landing.png?raw=true)

![search results](https://github.com/zeozeozeo/imgsearch/blob/main/results.png?raw=true)

(uses images from the LAION-5B image dataset)

# how to use

1. Generate a database file. An example of indexing 30000 images from the [Laion-5B dataset](https://www.kaggle.com/datasets/vitaliykinakh/guie-laion5b-dataset) can be found in [internal/index-laion.go](https://github.com/zeozeozeo/imgsearch/blob/main/internal/index-laion.go)
2. When starting up, it will look for a `database.txt` file. The file is structured like this:

```
/some/url/here.jpg 6845807407824432640
/another/url/here.jpg 296956165250596863
...
```

The second number stands for the image hash generated by the [imagesim](https://github.com/zeozeozeo/imagesim) library. Each line is a new image entry.

3. If you have your images saved locally, create an `images` folder in the same directory as the main file. It will index all images inside that folder and put them into `database.txt` (if it does not exist). Currently it only supports PNG and JPEG formats.

# command-line arguments (-h)

```
-embed
specifies whether templates and CSS should be embedded into the executable (default true)
-path string
path to database file (default "database.txt")
-port uint
port to start Gin on (default 8080)
-release
specifies whether Gin should run in release mode (default true)
-serve-images
specifies whether the images/ folder should be served
```