Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#184)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/kynan/nbstripout: 0.6.1 → 0.7.1](kynan/nbstripout@0.6.1...0.7.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 15, 2024
1 parent b4aae93 commit fcb2d55
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
files: ".ipynb"
Expand Down
20 changes: 10 additions & 10 deletions ammico/notebooks/cropposts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"cells": [
{
"cell_type": "markdown",
"id": "b25986d7",
"id": "0",
"metadata": {},
"source": [
"# Crop posts from social media posts images"
]
},
{
"cell_type": "markdown",
"id": "c8a5a491",
"id": "1",
"metadata": {},
"source": [
"Crop posts from social media posts images, to keep import text informations from social media posts images.\n",
Expand All @@ -20,7 +20,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "70ffb7e2",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -51,7 +51,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5ae02c45",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -64,7 +64,7 @@
},
{
"cell_type": "markdown",
"id": "e7b8127f",
"id": "4",
"metadata": {},
"source": [
"The cropping is carried out by finding reference images on the image to be cropped. If a reference matches a region on the image, then everything below the matched region is removed. Manually look at a reference and an example post with the code below."
Expand All @@ -73,7 +73,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d04d0e86",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -96,7 +96,7 @@
},
{
"cell_type": "markdown",
"id": "49a11f61",
"id": "6",
"metadata": {},
"source": [
"You can now crop the image and check on the way that everything looks fine. `plt_match` will plot the matches on the image and below which line content will be cropped; `plt_crop` will plot the cropped text part of the social media post with the comments removed; `plt_image` will plot the image part of the social media post if applicable."
Expand All @@ -105,7 +105,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "71850d9d",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -119,7 +119,7 @@
},
{
"cell_type": "markdown",
"id": "1929e549",
"id": "8",
"metadata": {},
"source": [
"Batch crop images from the image folder given in `crop_dir`. The cropped images will save in `save_crop_dir` folder with the same file name as the original file. The reference images with the items to match are provided in `ref_dir`.\n",
Expand All @@ -130,7 +130,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "eef89291",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand Down
32 changes: 16 additions & 16 deletions ammico/notebooks/facial_expressions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "d2c4d40d-8aca-4024-8d19-a65c4efe825d",
"id": "0",
"metadata": {},
"source": [
"# Facial Expression recognition with DeepFace"
Expand All @@ -12,7 +12,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "51f8888b-d1a3-4b85-a596-95c0993fa192",
"id": "1",
"metadata": {},
"source": [
"Facial expressions can be detected using [DeepFace](https://github.com/serengil/deepface) and [RetinaFace](https://github.com/serengil/retinaface).\n",
Expand All @@ -25,7 +25,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "50c1c1c7",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -50,7 +50,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b21e52a5-d379-42db-aae6-f2ab9ed9a369",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -60,7 +60,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "a2bd2153",
"id": "4",
"metadata": {},
"source": [
"We select a subset of image files to try facial expression detection on, see the `limit` keyword. The `find_files` function finds image files within a given directory and initialize the main dictionary that contains all information for the images and is updated through each subsequent analysis::"
Expand All @@ -69,7 +69,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "afe7e638-f09d-47e7-9295-1c374bd64c53",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -84,7 +84,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "a9372561",
"id": "6",
"metadata": {},
"source": [
"To check the analysis, you can inspect the analyzed elements here. Loading the results takes a moment, so please be patient. If you are sure of what you are doing, you can skip this and directly export a csv file in the step below.\n",
Expand All @@ -94,7 +94,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "992499ed-33f1-4425-ad5d-738cf565d175",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -105,7 +105,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "6f974341",
"id": "8",
"metadata": {},
"source": [
"Instead of inspecting each of the images, you can also directly carry out the analysis and export the result into a csv. This may take a while depending on how many images you have loaded."
Expand All @@ -114,7 +114,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6f97c7d0",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -125,7 +125,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "174357b1",
"id": "10",
"metadata": {},
"source": [
"These steps are required to convert the dictionary of dictionarys into a dictionary with lists, that can be converted into a pandas dataframe and exported to a csv file."
Expand All @@ -134,7 +134,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "604bd257",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -144,7 +144,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "8373d9f8",
"id": "12",
"metadata": {},
"source": [
"Check the dataframe:"
Expand All @@ -153,7 +153,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "aa4b518a",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -163,7 +163,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "579cd59f",
"id": "14",
"metadata": {},
"source": [
"Write the csv file - here you should provide a file path and file name for the csv file to be written."
Expand All @@ -172,7 +172,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4618decb",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit fcb2d55

Please sign in to comment.