hasdata
Determine if data is available to read from datastore
Syntax
Description
Examples
Determine Pixel Data Available to Read
Check if pixel label data can be read from a datastore.
Set the location of the image and pixel label data.
dataDir = fullfile(toolboxdir('vision'),'visiondata'); imDir = fullfile(dataDir,'building'); pxDir = fullfile(dataDir,'buildingPixelLabels');
Create an image and pixel label datastore.
imds = imageDatastore(imDir); classNames = ["sky" "grass" "building" "sidewalk"]; pixelLabelID = [1 2 3 4]; pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
While data is available in the datastore, read the data.
while hasdata(pxds) T = read(pxds); end
Input Arguments
ds
— Datastore with labeled data
PixelLabelDatastore
object | pixelLabelImageDatastore
object | boxLabelDatastore
object
Datastore with labeled data for training a semantic segmentation network
or an object detection network, specified as a pixelLabelDatastore
, pixelLabelImageDatastore
, or boxLabelDatastore
object.
Output Arguments
tf
— Datastore data status
1
| 0
Datastore data status, returned as a logical 1
(true
) if there is data available to read from the
datastore specified by ds
. Otherwise, it returns logical
0
(false
).
Version History
See Also
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)