Tag Archives: python

Data and methods available? Forget it!

Bergeat 2022

Data were available for 2 of 65 RCTs (3.1%) published before the ICMJE policy and for 2 of 65 RCTs (3.1%) published after the policy was issued (odds ratio, 1.00; 95% CI, 0.07-14.19; P > .99).

Danchev 2021

Among the 89 articles declaring that IPD would be stored in repositories, only 17 (19.1%) deposited data, mostly because of embargo and regulatory approval.

Gabelica 2022 (visualization @ Nature)

Of 3556 analyzed articles, 3416 contained DAS. The most frequent DAS category (42%) indicated that the datasets are available on reasonable request. Among 1792 manuscripts in which DAS indicated that authors are willing to share their data, 1670 (93%) authors either did not respond or declined to share their data with us. Among 254 (14%) of 1792 authors who responded to our query for data sharing, only 122 (6.8%) provided the requested data.

The same issue applies also to software sharing  where less than 5% of all papers is depositing code. And whenever they deposit software, it is even not running anymore a few years later as operating systems and libraries changed.

Both issues took me many years of my scientific life. It is recognized by politics in Germany but also the most recent action plan looks  … ridiculous. Why not making data and software sharing mandatory at time of publication?

Apropos Gasboykott – wie hoch ist eigentlich mein Gasverbrauch?

Den Gasverbrauch zu reduzieren wäre nun auch aus aktuellen politischen Gründen sinnvoll. Allerdings müsste man dafür den Verbrauch verstehen und nicht nur einmal im Jahr ablesen…

Katapult auf Twitter https://twitter.com/Katapultmagazin/status/1502327030150533125

Nachdem es mit etwas Computerkenntnissen möglich ist, einen Stromzähler mit einem Raspberry PI auszulesen, müsste die Methode auch beim Gaszähler funktionieren. Die “Gasuhr” funktioniert dabei so, dass zwei Balgen wechselseitig gefüllt werden und die Füllung einer Kammer über eine Kurbelmechanik ein Zählrad antreibt. Continue reading Apropos Gasboykott – wie hoch ist eigentlich mein Gasverbrauch?

The Python nightmare: How to install mask_rcnn and detectron2

Coming from R the most exciting thing with Python is the incompatibility of the different modules…

While I can recommend the Anaconda Navigator, the following commands work only in the terminal.

Thanks to Nouman945 for help with the original mask_rcnn instructions.

conda create --name matterport python=3.6.13 tensorflow==1.15.0 Keras==2.2.4 h5py==2.8.0 pip
conda activate matterport
git clone https://github.com/matterport/Mask_RCNN.git
cd ./Mask_RCNN-master
python -m pip install -r requirements.txt
git clone https://github.com/philferriere/cocoapi.git
python -m pip install pycocotools
python -m pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
wget https://github.com/matterport/Mask_RCNN/releases/download/v2.1/mask_rcnn_balloon.h5 > Mask_RCNN/mask_rcnn_coco.h5
conda deactivate

For detectron I follow basically detectron2.readthedocs.io

conda create --name detectron2 python=3.6.13 tensorflow==1.15.0 Keras==2.2.4 h5py==2.8.0 pip
conda activate detectron2
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 -c pytorch
git clone https://github.com/facebookresearch/detectron2.git
CC=clang CXX=clang++ ARCHFLAGS="-arch x86_64" python -m pip install -e detectron2
conda deactivate

Last but not least the installed apps:

From R to Python

It’s bit confusing if you are having long-term experience with R but need some OpenCV Python code. What worked for me

  1. download and install Python 3.8.3.
  2. pip install opencv-python
  3. pip install opencv-contrib-python
  4. although Spyder or Jupyter is recommended for data science, I went for PyCharm
  5. install Atom and follow the video instructions
  6. take care, numerous non working introductions out there, stick to recent version

python3 cv2 installation

Homebrew is struggling with the older python 2.7 version that is missing ssl support. Python 3.8 did not recognize cv2 but this finally worked

brew install python3
brew postinstall python3
pip3 install virtualenv virtualenvwrapper
virtualenv env_name --python="python3"
/Users/wjst/env_name/bin/pip3 install opencv-python
/Users/wjst/env_name/bin/pip3 install pandas scipy matplotlib Pillow tqdm sklearn imageio
/Users/wjst/env_name/bin/python3 -c "import cv2"

then I could finally run the image forgery detection from Github.

cd /Users/wjst/Desktop/image-copy-move-detection-master
/Users/wjst/env_name/bin/python3
> from copy_move_detection import detect
> ...