TIL imgaug library for augmenting images
Interesting to explore why this compiles:
extension Array where Element: Equatable {
// For empty array returns false
var allEqual: Bool {
if let firstElem = first {
return !dropFirst().contains { $0 != firstElem }
}
return false
}
}
While this isn’t:
extension Array where Element == Equatable {
// For empty array returns false
var allEqual: Bool {
if let firstElem = first {
return !dropFirst().contains { $0 != firstElem }
}
return false
}
}
Giving error Binary operator '!=' cannot be applied to two 'Equatable' operands
.
Came across library imgaug for augmenting images. Great that it deals with bounding boxes! That exactly what I need (contains referral for 100$ at digitalocean).