diff --git a/Dockerfile b/Dockerfile index 0b17cc5..ead019d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,20 @@ 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 +ENV CUDA_HOME="/usr/local/cuda" +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=. 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] diff --git a/setup.py b/setup.py index 1a759f5..7f912af 100644 --- a/setup.py +++ b/setup.py @@ -28,16 +28,15 @@ 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__", - ] + 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]