license import { TensorContainer } from '@tensorflow/tfjs-core' ; import { Dataset , datasetFromIteratorFn } from './dataset' ; import { CSVDataset } from './datasets/csv_dataset' ; import { iteratorFromFunction } from './iterators/lazy_iterator' ; import { MicrophoneIterator } from './iterators/microphone_iterator' ; import { WebcamIterator } from './iterators/webcam_iterator' ; import { URLDataSource } from './sources/url_data_source' ; import { CSVConfig , MicrophoneConfig , WebcamConfig } from './types' ; param source param csvConfig doc export function csv ( source , csvConfig = { } ) { return new CSVDataset ( new URLDataSource ( source ) , csvConfig ) ; } param f export function func < T extends TensorContainer > ( f ) { const iter = iteratorFromFunction ( f ) ; return datasetFromIteratorFn ( async ( ) => iter ) ; } param generator doc export function generator < T extends TensorContainer > ( generator ) { return datasetFromIteratorFn ( async ( ) => { const gen = await generator ( ) ; return iteratorFromFunction ( ( ) => gen . next ( ) ) ; } ) ; } param webcamVideoElement param webcamConfig doc export async function webcam ( webcamVideoElement ? , webcamConfig ? ) { return WebcamIterator . create ( webcamVideoElement , webcamConfig ) ; } param microphoneConfig doc export async function microphone ( microphoneConfig ? ) { return MicrophoneIterator . create ( microphoneConfig ) ; }