TIL how to train YOLO and a lot about Swift generics and how they are compiled
Bookmarking YOLOv4 Training Tutorial (Training YOLOv4 в Google Colab (Russian translation)). It’s very good step by step guide with example on recognizing car licenze plate.
Bookmarking Learning from the task “Recognizing traffic sings in frames from dashboard cam” (Russian). It’s about training YOLO, especially YOLO5 with resolution 1280 pixel which better suits to the task of recognizing relatively small images of traffic signs. Post is very usefull step-by-step trainign YOLO guide. I should follow this guide. All code is available on GitHub. Post refers Russian traffic sign images dataset. It’s 18GB of data. I have downloaded it for further use.
Continue reading Compiling Swift Generics. Surprize. Optional var in Swift is being initialized only if it’s declared with sugar syntax T?:
var x: Int?
print(x) // prints ‘nil’
var y: Optional<Int>
print(y) // error: use of uninitialized variable ‘y’
This is also curious to know:
The standard library declares a type alias
Voidwhose underlying type is ().
This as well:
An unlabeled one-element tuple type cannot be formed at all;
(T)resolves to the same type asTin the language.
Interesting, that beside of inout parameter could have attribute __owned or __shared. What these are for?
Fuck, finally I got what is metatype and what misterious .Type is:
Types are values in Swift, and a metatype is the type of a type used as a value. The metatype of a type
Tis written asT.Type. The typeTis the instance type of the metatype. The typeTis the instance type of the metatype. For example(() -> ()).Typeis the metatype type with the instance type() -> (). This metatype has one value, the function type () -> ().
Whaaaaaaaat?
let (x: Int, y: String) = (x: 123, y: "hello")
print(Int) // huh? prints 123
print(String) // weird! prints "hello"