from IPython import embed
embed()Type Ctrl-D to proceed
import lovely_tensors as lt| def clone_avd(src_avd_name, tar_avd_name, android_avd_home): | |
| """ | |
| Clone the source AVD to the target AVD. | |
| Parameters: | |
| - src_avd_name: The name of the source AVD folder. | |
| - tar_avd_name: The name of the target AVD folder. | |
| - android_avd_home: The path to the .android/avd directory. | |
| This function copies the source AVD folder and its .ini file to a new target AVD |
from IPython import embed
embed()Type Ctrl-D to proceed
import lovely_tensors as lt| # Given a numpy binary mask, the following function converts it to RLE encoding that MSCOCO defines | |
| # This implementation is highly vectorized and about 100X faster than naive python loop implmentations | |
| def binary_mask_to_rle(binary_mask): | |
| # Flatten the binary mask | |
| flat_mask = binary_mask.ravel(order='F') | |
| # Calculate the differences between consecutive elements in the flattened binary mask | |
| diffs = np.diff(np.concatenate(([0], flat_mask, [0]))) |
| kill $(ps aux | grep SCRIPT.py | grep -v grep | awk '{print $2}') |