@@ -89,7 +89,7 @@ Here, we access all the artifacts available for object detection, and select the
8989import qupath.ext.djl.*
9090
9191var artifacts = DjlZoo . listObjectDetectionModels()
92- var firstArtifact = artifacts[0 ]
92+ var firstArtifact = artifacts[0 ]. getDefaultArtifact()
9393println(firstArtifact)
9494```
9595
@@ -99,7 +99,7 @@ We can see a bit more by converting the artifact to JSON:
9999import qupath.ext.djl.*
100100
101101var artifacts = DjlZoo . listObjectDetectionModels()
102- var firstArtifact = artifacts[0 ]
102+ var firstArtifact = artifacts[0 ]. getDefaultArtifact()
103103var json = GsonTools . getInstance(true ). toJson(firstArtifact)
104104println(json)
105105```
@@ -142,7 +142,7 @@ boolean allowDownsamples = true
142142
143143// Get an object detection model from the zoo
144144var artifacts = DjlZoo.listObjectDetectionModels()
145- var artifact = artifacts[0]
145+ var artifact = artifacts[0].getDefaultArtifact()
146146
147147// Load the model
148148var criteria = DjlZoo.loadModel(artifact, allowDownsamples)
@@ -192,7 +192,7 @@ import qupath.ext.djl.*
192192// Get a semantic segmentation model
193193boolean allowDownloads = true
194194var artifacts = DjlZoo . listSemanticSegmentationModels()
195- var artifact = artifacts[0 ]
195+ var artifact = artifacts[0 ]. getDefaultArtifact()
196196println artifact
197197
198198// Apply the model
@@ -224,8 +224,8 @@ import ai.djl.Application.CV
224224
225225// Get all the image generation models with an 'artist' property
226226// Note that other image generation models may not work (since they expect different inputs)
227- var artifacts = DjlZoo . listModels(CV. IMAGE_GENERATION )
228- artifacts = artifacts . findAll(a - > a. properties. getOrDefault(" artist" , null ))
227+ var models = DjlZoo . listModels(CV. IMAGE_GENERATION )
228+ var artifacts = models . findAll(a - > a. getDefaultArtifact() . properties. getOrDefault(" artist" , null ))[ 0 ] . listArtifacts( )
229229
230230// Get an image
231231// Note: this shouldn't be too big! Define a maximum dimension
@@ -290,7 +290,8 @@ import ai.djl.Application.CV
290290import qupath.lib.gui.viewer.overlays.*
291291
292292// Get all the image generation models with an 'artist' property
293- var artifacts = DjlZoo . listModels(CV. IMAGE_GENERATION )
293+ var models = DjlZoo . listModels(CV. IMAGE_GENERATION )
294+ var artifacts = models. findAll(a - > a. getDefaultArtifact(). properties. getOrDefault(" artist" , null ))[0 ]. listArtifacts()
294295var artifact = artifacts. find(a - > a. properties[" artist" ] == " vangogh" )
295296
296297// Get an image
0 commit comments