build error

The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

Build logs:

Step 1/25 : ARG PYTHON_VERSION=3.8.9
Step 2/25 : FROM python:${PYTHON_VERSION}
 ---> dd4ac8dff24c
Step 3/25 : RUN apt-get update && apt-get install -y git-lfs
 ---> Using cache
 ---> f5a8a8611c8d
Step 4/25 : RUN git lfs install
 ---> Using cache
 ---> 89c45b1b3fd8
Step 5/25 : COPY packages.txt /root/packages.txt
 ---> Using cache
 ---> 6b302b88b33f
Step 6/25 : RUN apt-get update && xargs -r -a /root/packages.txt apt-get install -y
 ---> Using cache
 ---> 537c158fd1bc
Step 7/25 : RUN useradd -m user
 ---> Using cache
 ---> 628158bdedbc
Step 8/25 : USER user
 ---> Using cache
 ---> bc0c3a30768e
Step 9/25 : ENV HOME /home/user
 ---> Using cache
 ---> b16ded94d3cc
Step 10/25 : ENV PATH $HOME/.local/bin:$PATH
 ---> Using cache
 ---> a37fe14958a4
Step 11/25 : WORKDIR $HOME
 ---> Using cache
 ---> 65cb54a5ff2e
Step 12/25 : RUN mkdir app
 ---> Using cache
 ---> 28319bfd47e7
Step 13/25 : WORKDIR $HOME/app
 ---> Using cache
 ---> a09e232f92be
Step 14/25 : RUN pip install         datasets         huggingface-hub
 ---> Using cache
 ---> c68281c80cbb
Step 15/25 : COPY requirements.txt $HOME/app/requirements.txt
 ---> Using cache
 ---> 376d472e9258
Step 16/25 : RUN pip install -r requirements.txt
 ---> Running in cefa720fc4e5
Defaulting to user installation because normal site-packages is not writeable
Looking in links: https://download.pytorch.org/whl/torch_stable.html, https://download.openmmlab.com/mmcv/dist/cpu/torch1.8.0/index.html
Collecting torch==1.8.1+cpu
  Downloading https://download.pytorch.org/whl/cpu/torch-1.8.1%2Bcpu-cp38-cp38-linux_x86_64.whl (169.1 MB)
Collecting torchvision==0.9.1+cpu
  Downloading https://download.pytorch.org/whl/cpu/torchvision-0.9.1%2Bcpu-cp38-cp38-linux_x86_64.whl (13.3 MB)
Collecting sahi==0.8.12
  Downloading sahi-0.8.12-py3-none-any.whl (76 kB)
Collecting mmdet==2.18.1
  Downloading mmdet-2.18.1-py3-none-any.whl (1.2 MB)
Collecting mmcv-full==1.3.17
  Downloading https://download.openmmlab.com/mmcv/dist/cpu/torch1.8.0/mmcv_full-1.3.17-cp38-cp38-manylinux1_x86_64.whl (27.0 MB)
Collecting streamlit
  Downloading streamlit-1.2.0-py2.py3-none-any.whl (9.1 MB)
Collecting streamlit-image-comparison==0.0.1
  Downloading streamlit_image_comparison-0.0.1-py3-none-any.whl (4.7 kB)
Requirement already satisfied: numpy in /home/user/.local/lib/python3.8/site-packages (from torch==1.8.1+cpu->-r requirements.txt (line 3)) (1.21.4)
Requirement already satisfied: typing-extensions in /home/user/.local/lib/python3.8/site-packages (from torch==1.8.1+cpu->-r requirements.txt (line 3)) (4.0.0)
Collecting pillow>=4.1.1
  Downloading Pillow-8.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting terminaltables
  Downloading terminaltables-3.1.0.tar.gz (12 kB)
Collecting opencv-python>=4.2.0.32
  Downloading opencv_python-4.5.4.60-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.3 MB)
Collecting shapely>=1.8.0
  Downloading Shapely-1.8.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB)
Requirement already satisfied: requests in /home/user/.local/lib/python3.8/site-packages (from sahi==0.8.12->-r requirements.txt (line 5)) (2.26.0)
Collecting fire
  Downloading fire-0.4.0.tar.gz (87 kB)
Requirement already satisfied: tqdm>=4.48.2 in /home/user/.local/lib/python3.8/site-packages (from sahi==0.8.12->-r requirements.txt (line 5)) (4.62.3)
Requirement already satisfied: pyyaml in /home/user/.local/lib/python3.8/site-packages (from sahi==0.8.12->-r requirements.txt (line 5)) (6.0)
Collecting matplotlib
  Downloading matplotlib-3.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
Requirement already satisfied: six in /home/user/.local/lib/python3.8/site-packages (from mmdet==2.18.1->-r requirements.txt (line 6)) (1.16.0)
Collecting pycocotools
  Downloading pycocotools-2.0.3.tar.gz (106 kB)
Collecting yapf
  Downloading yapf-0.31.0-py2.py3-none-any.whl (185 kB)
Collecting addict
  Downloading addict-2.4.0-py3-none-any.whl (3.8 kB)
Requirement already satisfied: packaging in /home/user/.local/lib/python3.8/site-packages (from mmcv-full==1.3.17->-r requirements.txt (line 7)) (21.3)
INFO: pip is looking at multiple versions of mmcv-full to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of mmdet to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of sahi to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of torchvision to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of torch to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 9) and sahi==0.8.12 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested sahi==0.8.12
    streamlit-image-comparison 0.0.1 depends on sahi==0.8.11

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
WARNING: You are using pip version 21.1.1; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Removing intermediate container cefa720fc4e5