This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from skimage.util import map_array | |
from time import perf_counter | |
from skimage.util import map_array | |
shape = (50,1024,1024) | |
total = shape[0]*shape[1]*shape[2] | |
NUM_LABELS=total*2 | |
input_data = np.random.randint(NUM_LABELS,size=total).reshape(shape).astype("int64") | |
from_values = np.arange(NUM_LABELS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/sphire/sphire/bin/sp_gui.py | |
+++ b/sphire/sphire/bin/sp_gui.py | |
@@ -3093,7 +3093,10 @@ class SXCmdTab(QWidget): | |
self.qsub_script_edit = QLineEdit() | |
if self.sxcmdwidget.sxcmd.is_submittable == True: | |
- if 'SPHIRE_SUBMISSION_SCRIPT_TEMPLATE' in os.environ: | |
+ if 'SPHIRE_SUBMISSION_SCRIPT_TEMPLATE_GPU' in os.environ and \ | |
+ self.sxcmdwidget.sxcmd.name in ('sp_isac2_gpu', ): | |
+ submission_script_template = os.environ['SPHIRE_SUBMISSION_SCRIPT_TEMPLATE_GPU'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filter_single_image(img_path, filter_cutoff, resize_to_shape=None): | |
try: | |
image = imagereader.image_read(img_path) | |
except Exception: | |
print(img_path + " is corrupted. Ignore it.") | |
return None | |
return filter_single_image_np(image,filter_cutoff,resize_to_shape) | |
def filter_single_image_np(image, filter_cutoff, resize_to_shape=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dear SPHIRE users! | |
we would like to inform you about the release of crYOLO 1.7.5! It fixes several bugs: | |
Fixed a problem where the training was not working if no filter (like Low pass or JANNI ) was used. (Thanks to Andrea Nans) | |
The config file value max_box_per_image is now adapted automatically to the given training data. If this value was lower than the number of labeled particles per micrograph, not all particle were taken into account during training. The automatic adaption ensures that it is high enough. | |
Fixed a crash of crYOLO when no particles were picked. (Thanks to Grigory Sharov) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
###This script is to convert the xml file after picking to .coords files (txt). | |
###It can take the rotation applied before picking. | |
###It will also split the coordinates based on boundary line drawn during picking. | |
import argparse | |
import numpy as np | |
import subprocess | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Auto2DSelect.auto_2d_select import Auto2DSelectNet # Import cinderella | |
from Auto2DSelect import results_writer # Import writer | |
batch_size =4 # If you have memory problems, choose a smaller one | |
input_path = "path/to/classes.hdf" # path to your classes | |
weights_path = "path/to/weights.h5" # path to your trained model | |
# You can read the input size from the trained model or just set it to size used during training. | |
with h5py.File(weights_path, mode="r") as f: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.spatial.transform import Rotation as R | |
import numpy as np | |
import star | |
import transphire_transform.dump_load.star as trs | |
import os | |
input_path = "data/run_it024_data.star" | |
results_path = "results/test_results/" | |
result_filename = "run_it024_data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import argparse | |
import json | |
import os | |
from keras.utils import multi_gpu_model | |
import numpy as np | |
import time | |
from . import imagereader | |
from .frontend import YOLO | |
from .preprocessing import parse_annotation2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from . import imagereader | |
from .augmentation import Augmentation | |
import cv2 | |
import copy | |
from .utils import BoundBox, bbox_iou | |
import numpy as np | |
from keras.utils import Sequence | |
import threading | |
import multiprocessing | |
from multiprocessing import sharedctypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public FloatProcessor generateMask(int mask_size, int filamentwidth, int maskwidth, int type){ | |
FloatProcessor fp = new FloatProcessor(mask_size, mask_size); | |
double x0 = fp.getWidth()/2 + 0.5; | |
double y0 = fp.getHeight()/2 + 0.5; | |
double sigmax = maskwidth/2.355; //Full width at half maximum | |
double varx = sigmax*sigmax; | |
double sigmay = filamentwidth/2.355; | |
double vary = sigmay*sigmay; | |
for(int i = 0; i < mask_size; i++){ |
NewerOlder