{"id":16729888,"url":"https://github.com/dfdx/activeappearancemodels.jl","last_synced_at":"2025-03-15T17:22:06.552Z","repository":{"id":25712717,"uuid":"29149515","full_name":"dfdx/ActiveAppearanceModels.jl","owner":"dfdx","description":"Active Appearance Models","archived":false,"fork":false,"pushed_at":"2020-04-29T13:50:02.000Z","size":1047,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-22T07:16:55.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfdx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T18:19:44.000Z","updated_at":"2022-11-21T21:50:40.000Z","dependencies_parsed_at":"2022-08-24T14:13:05.973Z","dependency_job_id":null,"html_url":"https://github.com/dfdx/ActiveAppearanceModels.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfdx%2FActiveAppearanceModels.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfdx%2FActiveAppearanceModels.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfdx%2FActiveAppearanceModels.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfdx%2FActiveAppearanceModels.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfdx","download_url":"https://codeload.github.com/dfdx/ActiveAppearanceModels.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243763238,"owners_count":20344190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:30:27.583Z","updated_at":"2025-03-15T17:22:06.526Z","avatar_url":"https://github.com/dfdx.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"![travis](https://travis-ci.org/dfdx/ActiveAppearanceModels.jl.svg)\n\n# Active Appearance Models\n\nPort of Luca Vezzaro's [ICAAM](http://www.mathworks.com/matlabcentral/fileexchange/32704-icaam-inverse-compositional-active-appearance-models).\n\n## Introduction\n\nActive appearance models provide a way to find a set of related points on an image. AAMs are based on 2 main concepts: shape and appearance. \n\n**Shape** consists of a fixed number of points (so-called landmarks) that describe configuration of some object on an image. For example, here's a shape describing some human's face:\n\n![Shape](https://raw.githubusercontent.com/dfdx/ActiveAppearanceModels.jl/master/docs/data/readme_shape.png)\n\n**Appearance** is made of all pixels on the image inside the shape. E.g. appearance, corresponding to the shape above looks like this: \n\n![Appearance](https://raw.githubusercontent.com/dfdx/ActiveAppearanceModels.jl/master/docs/data/readme_app.png)\n\nActive appearance models are first trained on a bunch of `(image, shape)` pairs\tand then, given a new image and initial guess for a shape, are fitted to this image to find exact location of landmarks. Let's take a concrete example. \n\nFirst, we need some data to train a model on. `FaceDatasets` package contains a simple dataset from original research by Tim Cootes et al. that fits our needs: \n\n    using FaceDatasets\n    imgs = load_images(CootesDataset)\n    shapes = load_shapes(CootesDataset)\n   \nWe will use simple leave-one-one cross-validation to see how training and testing works:\n\n    tst = 6                                      # index of a test image\n    all_but_tst = [1:tst-1, tst+1:length(imgs)]  # all other indexes\n\n**Training** is simple: \n    \n    using ActiveAppearanceModels\n    aam = AAModel()\n    train(aam, imgs[all_but_tst], shapes[all_but_tst])\n\nFitting model to a new image requires 2 more parameters: initial shape and number of iterations: \n\n    init_shape = shapes[3]\n    n_iter = 20\n\nBefore fitting let's see initial landmark position:\n\n    viewshape(imgs[tst], init_shape)    \n\n![Init Shape](https://raw.githubusercontent.com/dfdx/ActiveAppearanceModels.jl/master/docs/data/readme_init_shape.png)\n\n\n**Fitting** itself is straightforward:\n\n    fitted_shape, fitted_app = fit(aam, imgs[tst], init_shape, n_iter)\n\n`fitted_shape` is what AAM believes is true position of landmarks, and `fitted_app` is corresponding appearance. Here's they are:\n\n    using ImageView\n    viewshape(imgs[tst], fitted_shape)\n    view(fitted_app)\n\n![Fitted Shape](https://raw.githubusercontent.com/dfdx/ActiveAppearanceModels.jl/master/docs/data/readme_fitted_shape.png)\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/dfdx/ActiveAppearanceModels.jl/master/docs/data/readme_fitted_app.png\" alt=\"Fitted App\" /\u003e\n\u003c/p\u003e\n\nFor interactive example of using AAMs see [`multu.jl`](https://github.com/dfdx/ActiveAppearanceModels.jl/blob/master/examples/multi.jl). \n\n\n## When fitting diverges\n\nActive appearance models use a variant of Lucas-Kanade algorithm and thus expect relatively small difference between initial and target shape. If difference is too large, fitting process will diverge (most often ending with `BoundsError`). This is easy to overcome, though, by repeating fitting with several variants of init shape. \n\n## References\n\nThis package closely follows original code in [ICAAM](http://www.mathworks.com/matlabcentral/fileexchange/32704-icaam-inverse-compositional-active-appearance-models) project. ICAAM, in its turn, implements inverse compositional approach to AAMs first described in: \n\n\u003e Matthews, I., Baker, S. Active appearance models revisited. International Journal of Computer Vision 60 (2004) 135 – 164","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfdx%2Factiveappearancemodels.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfdx%2Factiveappearancemodels.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfdx%2Factiveappearancemodels.jl/lists"}