* use pip with ipython magic and not terminal

* loosen setuptools version for colab notebooks

* update install instructions
Этот коммит содержится в:
Inga Ulusoy 2023-05-05 11:45:59 +02:00 коммит произвёл GitHub
родитель 530c8525a8
Коммит 90d049fdf7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 22 добавлений и 21 удалений

Просмотреть файл

@ -34,9 +34,9 @@ Use pre-processed image files such as social media posts with comments and proce
## Installation
The `AMMICO` package can be installed using pip: Navigate into your package folder `ammico/` and execute
The `AMMICO` package can be installed using pip:
```
pip install .
pip install git+https://github.com/ssciwr/ammico.git
```
This will install the package and its dependencies locally.

19
notebooks/cropposts.ipynb сгенерированный
Просмотреть файл

@ -39,11 +39,11 @@
"outputs": [],
"source": [
"# load ref view for cropping the same type social media posts images.\n",
"ref_view = np.array(Image.open(\"data/ref/ref-00.png\"))\n",
"ref_view = np.array(Image.open(\"../data/ref/ref-00.png\"))\n",
"plt.imshow(ref_view)\n",
"plt.show()\n",
"\n",
"view = np.array(Image.open(\"data/napsa/100539_ben.png\"))\n",
"view = np.array(Image.open(\"../data/all/102790S_eng.png\"))\n",
"plt.figure(figsize=(10, 15))\n",
"plt.imshow(view)\n",
"plt.show()"
@ -62,7 +62,8 @@
")\n",
"\n",
"# save cropped images\n",
"cv2.imwrite(\"data/100539_ben.png\", crop_view)"
"cv2.imwrite(\"test.png\", crop_view)\n",
"print(match_num)"
]
},
{
@ -72,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"view2 = np.array(Image.open(\"data/napsa/100541_ben.png\"))\n",
"view2 = np.array(Image.open(\"../data/all/102790S_eng.png\"))\n",
"plt.figure(figsize=(10, 15))\n",
"plt.imshow(view2)\n",
"plt.show()"
@ -101,9 +102,9 @@
"# Batch crop images from image folders.\n",
"# The cropped images will save in save_crop_dir folders with the same file name form origin.\n",
"# We can set many types reference images in ref_dir folder, to crop posts images in different types social media, like twitter or facebook.\n",
"ref_dir = \"./data/ref\"\n",
"crop_dir = \"./data/apsa\"\n",
"save_crop_dir = \"data/crop\"\n",
"ref_dir = \"../data/ref\"\n",
"crop_dir = \"../data/all\"\n",
"save_crop_dir = \"../data/crop\"\n",
"crpo.crop_posts_from_files(\n",
" ref_dir, crop_dir, save_crop_dir, plt_match=False, plt_crop=False\n",
")\n",
@ -122,7 +123,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@ -136,7 +137,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.9.16"
}
},
"nbformat": 4,

4
notebooks/facial_expressions.ipynb сгенерированный
Просмотреть файл

@ -34,9 +34,9 @@
"if \"google.colab\" in str(get_ipython()):\n",
" # update python version\n",
" # install setuptools\n",
" !pip install setuptools==61 -qqq\n",
" # %pip install setuptools==61 -qqq\n",
" # install ammico\n",
" !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" %pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n",
" from google.colab import drive\n",
"\n",

4
notebooks/get-text-from-image.ipynb сгенерированный
Просмотреть файл

@ -39,9 +39,9 @@
"if \"google.colab\" in str(get_ipython()):\n",
" # update python version\n",
" # install setuptools\n",
" !pip install setuptools==61 -qqq\n",
" # %pip install setuptools==61 -qqq\n",
" # install ammico\n",
" !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" %pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n",
" from google.colab import drive\n",
"\n",

4
notebooks/image_summary.ipynb сгенерированный
Просмотреть файл

@ -31,9 +31,9 @@
"if \"google.colab\" in str(get_ipython()):\n",
" # update python version\n",
" # install setuptools\n",
" !pip install setuptools==61 -qqq\n",
" # %pip install setuptools==61 -qqq\n",
" # install ammico\n",
" !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" %pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n",
" from google.colab import drive\n",
"\n",

4
notebooks/multimodal_search.ipynb сгенерированный
Просмотреть файл

@ -34,9 +34,9 @@
"if \"google.colab\" in str(get_ipython()):\n",
" # update python version\n",
" # install setuptools\n",
" !pip install setuptools==61 -qqq\n",
" # %pip install setuptools==61 -qqq\n",
" # install ammico\n",
" !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" %pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n",
" from google.colab import drive\n",
"\n",

4
notebooks/objects_expression.ipynb сгенерированный
Просмотреть файл

@ -31,9 +31,9 @@
"if \"google.colab\" in str(get_ipython()):\n",
" # update python version\n",
" # install setuptools\n",
" !pip install setuptools==61 -qqq\n",
" # %pip install setuptools==61 -qqq\n",
" # install ammico\n",
" !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" %pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n",
" from google.colab import drive\n",
"\n",