2023-10-23 12:28:35 +02:00
|
|
|
import Foundation
|
|
|
|
|
2023-10-23 14:58:58 +02:00
|
|
|
struct Configuration {
|
2023-10-23 12:28:35 +02:00
|
|
|
|
|
|
|
let contentFolder: String
|
2023-10-23 14:58:58 +02:00
|
|
|
|
2023-10-23 12:28:35 +02:00
|
|
|
let trainingIterations: Int
|
|
|
|
|
|
|
|
let serverPath: String
|
|
|
|
|
|
|
|
let authenticationToken: String
|
2024-10-28 19:06:45 +01:00
|
|
|
|
|
|
|
let minimumImagesPerCap: Int
|
2023-10-23 14:58:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extension Configuration {
|
2023-10-23 12:28:35 +02:00
|
|
|
|
|
|
|
func serverUrl() throws -> URL {
|
|
|
|
guard let serverUrl = URL(string: serverPath) else {
|
2023-10-23 16:49:56 +02:00
|
|
|
throw TrainingError.invalidServerPath(serverPath)
|
2023-10-23 12:28:35 +02:00
|
|
|
}
|
|
|
|
return serverUrl
|
|
|
|
}
|
|
|
|
}
|