downloader = $downloader; } /** * Configure the command * * @return void */ protected function configure() { $this->setName('recognize:download-models') ->setDescription('Download the necessary machine learning models'); } /** * Execute the command * * @param InputInterface $input * @param OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->downloader->download(); } catch (\Exception $ex) { $output->writeln('Failed to download models'); $output->writeln($ex->getMessage()); return 1; } return 0; } }