vitali-fedulov / images4 Goto Github PK
View Code? Open in Web Editor NEWImage similarity in Golang. Version 4 (LATEST)
Home Page: https://vitali-fedulov.github.io/similar.pictures/
License: MIT License
Image similarity in Golang. Version 4 (LATEST)
Home Page: https://vitali-fedulov.github.io/similar.pictures/
License: MIT License
Hi, it's an awesome project for duplicate image removal. I use this project to detect and delete images, but I encountered some issues.
For example, there are two thumbnails which are very alike from my raw eyes. But images4.Similar
returns false in this case.
Is there any way to optimize this situation?
Could you please add the MarshalJSON
function to null
the Icon
type in JSON encoding, or add the json:",omitempty"
flag to omit empty values in Icon
and ImgSize
types?
I have loads of images in my data and when I want to browse through them in JSON format, I get bigger than necessary JSON files since there are lots of empty images. ๐
Current marshal result:
{
"Icon": {
"Pixels": null,
"ImgSize": {
"X": 0,
"Y": 0
}
}
}
You can imagine how big it gets when there are lots of empty icons in the array. ๐ต
This results in smaller size than the suggestion 2.
func (i IconT) MarshalJSON() ([]byte, error) {
if i.Pixels == nil {
return []byte("null"), nil
}
return json.Marshal(struct {
Pixels []uint16
ImgSize Point
}{i.Pixels, i.ImgSize})
}
Output:
{
"Icon": null
}
json:",omitempty"
flagThis reduces the size by removing the "Pixels", "X" and "Y" fields.
type IconT struct {
Pixels []uint16 `json:",omitempty"` // Visual signature.
ImgSize image.Point `json:",omitempty"` // Original image size.
}
type Point struct {
X, Y int `json:",omitempty"`
}
Output:
{
"Icon": {
"ImgSize": {}
}
}
Do you have any better suggestions? ๐ค
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.