icatcherplus / icatcher_plus

iCatcher+: Robust and automated annotation of infant gaze from videos collected in laboratory, field, and online studies
GNU General Public License v3.0
18 stars 19 forks source link

WIP/integrate results visualization UI #70

Closed deirdre-k closed 1 year ago

deirdre-k commented 1 year ago

This PR contains four main changes:

  1. Addition of web app code to src/icatcher/icatcher_app directory. This directory contains two folders, one housing all of the React-based front-end code, and the other containing a very basic flask API.
  2. A MANIFEST.in that specifies the potential location of the built React app (src/icatcher/icatcher_app/frontend/). The React build files are not visible in the repository code, but can be created by running npm build in the frontend directory.
  3. An addition to the publish.yml github workflow that adds in steps to build the React app and make the resulting build directory available to be included in the pip package.
  4. An additional script entrypoint, specified in pyproject.toml, that makes it possible for users to start up the UI by running icatcher-app in the command line

In order to be complete, this PR still needs the addition of a script to produce the necessary output to run the UI. The UI relies on having a metadata.json file and a directory of unpacked, decorated frames in order to run. I propose to add an optional iCatcher CLI flag --app that will auto-generate these outputs, as well as a script that can be run after a video is processed so that already processed videos don't necessarily need to be re-run.

yoterel commented 1 year ago

Hi, awesome work.

I noticed you attempted to merge master into your branch, but something went wrong with this merge as files are still shown as being updated (e.g. under /reproduce), and some files even have merge conflicts such as pyproject.yml... ("<<<HEAD", etc.) I suggest you either withdraw the PR, merge correctly locally and resubmit it, or rebase your branch to master for a cleaner history, or if you want, I can do this for you by checking out the prior commit and submitting it myself.

Let me know which option suits you best.

In theory, no files except perhaps the cli.py and pyproj.yml should be touched by this PR. I am expecting to see newly added files, and minor edits in these two files only.

deirdre-k commented 1 year ago

Hi @yoterel thanks for taking a look! Yeah it seems like the fork this came from got a bit out of sync with the main repo, which made the merge behave in weird ways and pick up some previously untracked differences between the two. Instead of trying to untangle by hand, I've added my code to the the dk/integrate_ui branch of this repo and will open a new PR with that branch once I've completed the changes we discussed on Wednesday.

I believe you're correct that this PR should only touch cli.py and pyproject.toml, with the addition of the publish and test git workflows, and all other changes should be new files within the src/icatcher/icatcher_app directory.

I'll close the PR for now, thanks for reviewing the UI code!