Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
3.9 kB · 181 lines
Nix
at gcc-offload
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182{ stdenv, lib, buildPythonPackage, fetchFromGitHub, ninja, which, # build inputs pillow, matplotlib, pycocotools, termcolor, yacs, tabulate, cloudpickle, tqdm, tensorboard, fvcore, iopath, omegaconf, hydra-core, packaging, torch, pydot, black, # optional dependencies fairscale, timm, scipy, shapely, pygments, psutil, # check inputs pytestCheckHook, torchvision, av, opencv4, pytest-mock, pybind11,}:
let pname = "detectron2"; version = "0.6"; optional-dependencies = { all = [ fairscale timm scipy shapely pygments psutil ]; };inbuildPythonPackage { inherit pname version; format = "setuptools";
src = fetchFromGitHub { owner = "facebookresearch"; repo = "detectron2"; rev = "refs/tags/v${version}"; sha256 = "1w6cgvc8r2lwr72yxicls650jr46nriv1csivp2va9k1km8jx2sf"; };
postPatch = '' # https://github.com/facebookresearch/detectron2/issues/5010 substituteInPlace detectron2/data/transforms/transform.py \ --replace "interp=Image.LINEAR" "interp=Image.BILINEAR" '';
nativeBuildInputs = [ ninja which ];
buildInputs = [ pybind11 ];
pythonRelaxDeps = [ "black" ];
propagatedBuildInputs = [ pillow matplotlib pycocotools termcolor yacs tabulate cloudpickle tqdm tensorboard fvcore iopath omegaconf hydra-core packaging black torch # not explicitly declared in setup.py because they expect you to install it yourself pydot # no idea why this is not in their setup.py ];
optional-dependencies = optional-dependencies;
nativeCheckInputs = [ av opencv4 pytest-mock pytestCheckHook torchvision ];
preCheck = '' # prevent import errors for C extension modules rm -r detectron2 '';
pytestFlagsArray = [ # prevent include $sourceRoot/projects/*/tests "tests" ];
disabledTestPaths = [ # try import caffe2 "tests/test_export_torchscript.py" "tests/test_model_analysis.py" "tests/modeling/test_backbone.py" "tests/modeling/test_roi_heads.py" "tests/modeling/test_rpn.py" "tests/structures/test_instances.py" # hangs for some reason "tests/modeling/test_model_e2e.py" # KeyError: 'precision' "tests/data/test_coco_evaluation.py" ];
disabledTests = [ # fails for some reason "test_checkpoint_resume" "test_map_style" # requires shapely "test_resize_and_crop" # require caffe2 "test_predict_boxes_tracing" "test_predict_probs_tracing" "testMaskRCNN" "testRetinaNet" # require coco dataset "test_default_trainer" "test_unknown_category" "test_build_dataloader_train" "test_build_iterable_dataloader_train" # require network access "test_opencv_exif_orientation" "test_read_exif_orientation" # use deprecated api, numpy.bool "test_BWmode_nomask" "test_draw_binary_mask" "test_draw_empty_mask_predictions" "test_draw_instance_predictions" "test_draw_no_metadata" "test_overlay_instances" "test_overlay_instances_no_boxes" "test_get_bounding_box" ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ "test_build_batch_dataloader_inference" "test_build_dataloader_inference" "test_build_iterable_dataloader_inference" "test_to_iterable" ];
pythonImportsCheck = [ "detectron2" ];
meta = with lib; { description = "Facebooks's next-generation platform for object detection, segmentation and other visual recognition tasks"; homepage = "https://github.com/facebookresearch/detectron2"; license = licenses.asl20; maintainers = with maintainers; [ happysalada ]; };}