New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new command to install models #189
Conversation
TODO:
|
lib/Command/InstallModelsCommand.php
Outdated
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class InstallModelsCommand extends Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, I was wondering... can we make this a bit generic. We already discussed this in the form of ./occ face:recommend_memory
(here. Can you name this command, someting like ./occ face:setup
or ./occ face:prepare
or ./occ face:first_time_setup
or ./occ face:initialize
.... point is, we can use this same command later, not just for downloading models, but this is a place we can tell people "hey, your recommended memory is not high" or "hey, DLib does not exist", or "hey, PDLib cannot be initialized"... instead of having 2-3-5 commands for this, why not make it one? At this moment, it can contain only models, but in the future, we can bundle all various things in here. First next step to merge in this command would be check requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.. ./occ face:setup
Now without an argument, but then ./occ face:setup model 2
, ./occ face:setup memory
can be added. I did not like setup
, but it is the most generic, and can be consistent with the arguments.
lib/Command/InstallModelsCommand.php
Outdated
$this->logger = $output; | ||
|
||
$this->tempFolder = $this->tempManager->getTemporaryFolder('/facerecognition/'); | ||
$this->modelsFolder = $this->appManager->getAppPath('facerecognition') . '/vendor/models/1/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so....how this works? If now are our models not part of our install/bundle/zip and they reside inside our app, what happens when users upgrade our app? models do disappear and user need to execute ./occ face:install_models
again? If this is not true, ignore my comment. But if this is true, this would be real pain for users. However, I am not sure what other location we can have at our disposal to place models there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so....how this works? If now are our models not part of our install/bundle/zip and they reside inside our app, what happens when users upgrade our app? models do disappear and user need to execute ./occ face:install_models again?
Wow.. God point..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I am not sure what other location we can have at our disposal to place models there?
appdata_INSTANCE_ID seems a good place.. There are saved the preview, avatars, richdocuments templates, deck images, etc. etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for my comments
d7dd360
to
24a3b7a
Compare
Ok.. The last commit doesn't work and I don't know why ... 😢 Also change the model folder to the The error was:
|
Did 'doh' commit (8db816c) solved problem, or I should try it locally?:) |
No.. 😞
Yes please.. At least look at all the diff to see if you notice anything .. |
@stalker314314 |
Now it seems to work. 😄 |
@@ -54,6 +54,7 @@ before_script: | |||
- cd apps/$APP_NAME | |||
|
|||
script: | |||
- ./occ face:setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it really doesn't matter, but isn't it more logical to have make test
and only after face:setup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it really doesn't matter, but isn't it more logical to have make test and only after face:setup?
I modified it in case there was any test that depended on the models. Change it along with the necessary tests. 😉
Everything mostly works, other than stuff I mentioned:) I still cannot visit |
All done. |
Ok, The app store has a limit of 20Mb and our proposed application with the models weighs 27.8 MB.
Well, If we intended to support various models, at some point we had to do something like this.
This is not so happy either, because when you download the files in the application folder we change your checksum, and we will have reports that there are changed files.
Simil that:
I think that at this stage of testing, this is acceptable, but we must place the models in a more appropriate directory.