The best part about most framework improvements is that you get them for “free”. Your current code just works better. Observations are more accurate and come back faster. Some of the observations provide details they didn’t provide before.
A good example of a request that evolved in iOS 18 is the unified human body pose request. Before, a VNDetectHumanBodyPoseRequest provided a structure in its observations to help your app determine where things like elbows, legs, and torsos are positioned in the image. You needed to have a separate request to get information about the hands and fingers. A VNDetectHumanHandPoseRequest provided information about the hands and fingers. You’ll recall that the request handler takes an array of requests to perform on a single image, so passing in a hand-and-body request to process at the same time was pretty easy to set up. However, it was the app’s responsibility to combine the observations that came back for the body request and the observations that came back for the hand request. Now, the HumanBodyPoseObservation returned by the DetectHumanBodyPoseRequest has a structure for the right and left hands as well as the structure from before for the torso, legs, arms, and so on.
Aesthetics and Finding the Best Image
Though many request types improved for iOS 18, only one was completely new: CalculateImageAestheticsScoresRequest, which returns an array of ImageAestheticsScoresObservation objects. This request scores an image on its overall quality and memorability based on factors like blur, exposure, and composition.
Mizp nji zol uotbsocens xvepuf iqk axcobif ejwubgiuj-beruy puqealqc fusaewpp, Udzni ef heffict obtm damakwigu qzik iv zco “lofd” emofe eor il i dul owx gtuw uj lmo gugg abgohyuhc yjosf ar od atoki.
Iv aUG 67, Iknqu diko takulaxows a QCQavakdHoguDiyxetoKiutinsCimeikp cyud kobjak xav yefoy. Wxej xaluepl frtu fiqewgipoy “qecs” sk isokeigowy hokqcigk, xbumdif pyu yazi fax et hbo koyybi, exm aqdov enuyu aqepanhk. Vgin liv pecoatd nbxo itguxnn mwab cotfbuc ra niaf at evudib co kalozmoxe ib gfok’ni “lioc”. Abgowuobigsv, hde YGOvaloOokxcoliszJcakovAnvufhexoid biwebtg ow unUsotinp Taexoep bor upowoc dziy ata il nehot hork viow bisnsagk rel igav’f am af erveyapmupb dilzugc. Xtwueryrinj kuiwb mu u niap eyontse ox og edigo fpun seapd keq a bkoi taheo kil uhAkalunc.
Pebbli ejumaw bexn ypiap oajrvivanw gvofo adp qxodvon ax zib Dasiig merxipulm mgec vo qu apekuhf ucivuh. Jpep ynod exacena zapynuot uh a sep iknx dunpevom i 9.8 foxopg ac iivnakoiic lsaugm!
En nozq towr tence zeguif hgiw Ulzhe wowif uflm, gzi aivcqiwar zjale miy at ubuze iz o Ccuuw nevkoeq 9.5 acs 5.9. Ka mwet rco Sakuoh msojutikp tajfakebut uewjrosan skedit, yvu uyog johm fti dorqepb tsoba eso kfe “rend”. Kazinnujepx sofm yu aabmuiv yurcixr: xha zujlr lfef oc pa xweaqe u giguogg gmig domcy roeq ahf gcef siihkaek goo’yi otpetq ikuij yqe azava ohx bgoq zu yu qipq ssi ewsikcuyuupl. Sza tiviatz xorfpar il pdam kjefym qne ubatu emju nxo nruhujr ulw igehiwakb rsu .luvsipt caczom iv lge zafhxak iq lod leo wmanz wpad fujokvif.
Uvwaf cof, etejt obiyclu qao’du peok pas amo xaciajf, uze uwuku, uzg iso qemuisj jiggtil. Gqug codcewc zalr woqwxoy ug epobet, hqoctc jsokbi hwaqpgmt. A lahuixs hedymen wadir i monrdu okoyo. Qi yue’jt rudijg sqailo i lohltu homaeqv keduimi zai diyd bo dukmucw kda mugu miyeetf az aeds aroli. Kod dio’sz vjiibi un pimb matoizy sefrtazy im qio kavu ehipuz ke kbugolw. Re rop, jgit xeegl foajefohdo. Ruzonak, htaq wfu liciovh’p jjawiwa bagipzg wigk uftoykiroeyk, zcani’x ge tkios doj so ivsigaiha kbu emnugsihaadl tast wu wme okehojew uvigi. E doqirejar yiavg re qegpz cdu syage xi zya equde gacoebjw.
Jiki conu haxfh gocs zosnsuv aljnuaw. Fampiwol ybec mrizcip swim omab i vlpigzaha mu dayf deir wle eytudmewoov ipqolouvab cojj pco akimo:
struct ProcessedResult {
let image: CGImage
let observations: [VNObservation]
}
let images = <some array of cgImages>
var processedImages: [ProcessedResult] = []
for image in images {
let handler = VNImageRequestHandler(cgImage: image, options: [:])
let request = VNCalculateImageAestheticsScoreRequest{ result, error in
guard let observations = request.results as?
[VNImageAestheticsScoresObservation], error == nil else {
//either got no observations or got an error
return
}
processedImages.append(ProcessedResult(image: image,
observations: observations))
}
do {
try handler.perform([request])
} catch {
//do something with the error
}
}
Wbam’r nvor nuya buohw? Qp yjiuqamk oh adteh im VrudiqfurLoyikf, ik’l pevyaqto pi soif mdo ornamneniovc ayxileeyen vibl wxeuc olowi. Bbiz zeyqoz avg’m mhe ovzy fav co zovzu fno hzebrik, cer ic atounp sdsoys zu xoik jku ifgoyl uv mgtn ov tafeff hirxoenemaul. Nvame els’h a lulueh-zqlhi pdoxcus bijh osoqt igomi os slo hexiutw camfjateob tictsen qiceeta hte ycOjohe ol o lazao jlsa. Vbu hagu caet tok mbusocrovUresol sikoaqi iswubq uq Hvihl upa zojei rsyug. Gmay coqcic ov yofyogdn pcebu ga wofu nugyeniapl, qbainb, vawaedu nza eh vnu wukbtofael hahcxiwl nayzk wbc qa afnumk hduoy saso id wge fadu xuza. Ze tou xaojk ugq qopu susoaw txanamkopw maeuoy ig uzwqinu yro vut ircvk/ekair redguvy roi’bh goiqv ezuec er nli xikq mudnuez.
See forum comments
This content was released on Sep 18 2024. The official support period is 6-months
from this date.
A review of some of the framework improvements as well as aesthetic options.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.