I am trying to write a bash script to execute a workflow for making a database, annotate, combine with some other annotation files, train and evaluate. I am struggling to find a way to exit the prodigy server for the annotations stage. Each annotation file will have the same number of documents so perhaps I could use that and try kill it after that number of documents has been reached. Can you advise me on the best approach please?
Perhaps you could write a custom recipe that keeps the counter and terminates the server when your condition is reached? The custom recipe can call into the built-ins, so it’s quite easy to have a wrapper around the stream. The docs for this are here: https://prodi.gy/docs/workflow-custom-recipes
If that won’t work, another place you could put the logic is in the
app.py, which defines the REST service. We provided the source for this so that you’d be able to add endpoints if necessary. Perhaps you could add an endpoint that kills the server?
Finally, I don’t think there’s anything wrong with sending an exit signal to the process using
Hey, I have the same question. But where can I find the app.py file? (Sorry for the silly question). I want to create an end point to exit the server once all images are annotated.
It's just inside your Prodigy installation. You can run
python -m prodigy stats and it should show you the directory Prodigy is installed within. The
app.py will be within that directory.