From cc8db61f28cce033302f8f837a7bd075a73689c5 Mon Sep 17 00:00:00 2001 From: ymir Date: Wed, 24 May 2023 15:16:49 +0800 Subject: [PATCH 1/4] update --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0b17cc5..203afd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,19 @@ FROM pengchuanzhang/pytorch:ubuntu20.04_torch1.9-cuda11.3-nccl2.9.9 ENTRYPOINT [] +# install GLIP +RUN mkdir /app/MODEL -p +RUN wget https://penzhanwu2bbs.blob.core.windows.net/data/GLIPv1_Open/models/swin_tiny_patch4_window7_224.pth \ + -O /app/MODEL/swin_tiny_patch4_window7_224.pth +RUN wget https://penzhanwu2bbs.blob.core.windows.net/data/GLIPv1_Open/models/glip_a_tiny_o365.pth \ + -O /app/MODEL/glip_a_tiny_o365.pth +RUN pip install einops shapely timm yacs tensorboardX ftfy prettytable pymongo transformers loralib==0.1.1 +COPY . /app +RUN cd /app && python setup.py build develop --user && cd / + +# setup ymir & ymir-GLIP RUN pip install "git+https://github.com/modelai/ymir-executor-sdk.git@ymir2.4.0" -COPY . /app RUN mkdir /img-man && mv /app/ymir/img-man/*.yaml /img-man/ ENV PYTHONPATH=. From 190b497e2411453e6104619b512ee63539129d77 Mon Sep 17 00:00:00 2001 From: ymir Date: Wed, 24 May 2023 17:05:29 +0800 Subject: [PATCH 2/4] update --- Dockerfile | 1 + setup.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 203afd0..ead019d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN wget https://penzhanwu2bbs.blob.core.windows.net/data/GLIPv1_Open/models/gli -O /app/MODEL/glip_a_tiny_o365.pth RUN pip install einops shapely timm yacs tensorboardX ftfy prettytable pymongo transformers loralib==0.1.1 COPY . /app +ENV CUDA_HOME="/usr/local/cuda" RUN cd /app && python setup.py build develop --user && cd / # setup ymir & ymir-GLIP diff --git a/setup.py b/setup.py index 1a759f5..11b2453 100644 --- a/setup.py +++ b/setup.py @@ -28,16 +28,16 @@ def get_extensions(): extra_compile_args = {"cxx": []} define_macros = [] - if torch.cuda.is_available() and CUDA_HOME is not None: - extension = CUDAExtension - sources += source_cuda - define_macros += [("WITH_CUDA", None)] - extra_compile_args["nvcc"] = [ - "-DCUDA_HAS_FP16=1", - "-D__CUDA_NO_HALF_OPERATORS__", - "-D__CUDA_NO_HALF_CONVERSIONS__", - "-D__CUDA_NO_HALF2_OPERATORS__", - ] + # if torch.cuda.is_available() and CUDA_HOME is not None: + extension = CUDAExtension + sources += source_cuda + define_macros += [("WITH_CUDA", None)] + extra_compile_args["nvcc"] = [ + "-DCUDA_HAS_FP16=1", + "-D__CUDA_NO_HALF_OPERATORS__", + "-D__CUDA_NO_HALF_CONVERSIONS__", + "-D__CUDA_NO_HALF2_OPERATORS__", + ] sources = [os.path.join(extensions_dir, s) for s in sources] From d8e3901d7a3813d4da2336a479e6c7789c20c8ad Mon Sep 17 00:00:00 2001 From: ymir Date: Wed, 24 May 2023 17:07:15 +0800 Subject: [PATCH 3/4] update --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 11b2453..7f912af 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ def get_extensions(): extra_compile_args = {"cxx": []} define_macros = [] - # if torch.cuda.is_available() and CUDA_HOME is not None: extension = CUDAExtension sources += source_cuda define_macros += [("WITH_CUDA", None)] From ac1cc733657639e8cd12389791f15cc2b2481332 Mon Sep 17 00:00:00 2001 From: ymir Date: Wed, 24 May 2023 17:57:56 +0800 Subject: [PATCH 4/4] update --- maskrcnn_benchmark/data/datasets/coco.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maskrcnn_benchmark/data/datasets/coco.py b/maskrcnn_benchmark/data/datasets/coco.py index 095af9e..78a2ade 100644 --- a/maskrcnn_benchmark/data/datasets/coco.py +++ b/maskrcnn_benchmark/data/datasets/coco.py @@ -223,10 +223,10 @@ def __getitem__(self, idx): classes = torch.ones_like(classes) target.add_field("labels", classes) - if anno and "segmentation" in anno[0]: - masks = [obj["segmentation"] for obj in anno] - masks = SegmentationMask(masks, img.size, mode='poly') - target.add_field("masks", masks) + # if anno and "segmentation" in anno[0]: + # masks = [obj["segmentation"] for obj in anno] + # masks = SegmentationMask(masks, img.size, mode='poly') + # target.add_field("masks", masks) if anno and "cbox" in anno[0]: cboxes = [obj["cbox"] for obj in anno]